carbon-components-svelte/src/components/Select/SelectItem.svelte
Eric Liu c446fc74f4 refactor(components): convert const to reactive where appropriate
- Inline class assignments to avoid script-level clutter
- Ignore a11y-missing-attribute instead of redundant href
2019-12-24 09:41:12 -08:00

24 lines
491 B
Svelte

<script>
let className = undefined;
export { className as class };
export let value = '';
export let text = '';
export let disabled = false;
export let hidden = false;
export let style = undefined;
import { getContext } from 'svelte';
import { cx } from '../../lib';
const { selected } = getContext('Select');
</script>
<option
selected={$selected === value}
class={cx('--select-option', className)}
{value}
{disabled}
{hidden}
{style}>
{text}
</option>