import { storiesOf } from '@storybook/vue'
import { defineComponent, ref, computed, onMounted } from '@vue/composition-api'
import { useSelect } from '../index'
import md from '../docs/select.md'
const Count = defineComponent({
template: `
option: {{options}}
selected: {{selected}}
(click to remove)
EXAMPLE - default select
(click to select anyway)
EXAMPLE - select width filter
(click to select width filter)
`,
setup() {
const {
muti, options, selected,
select, selectAll, remove, removeAll, isSelected
} = useSelect("id")
options.value = [
{ id: 1 },
{ id: 2 },
{ id: 3 },
]
muti.value = true
return {
options, selected,
select, selectAll, remove, removeAll, isSelected
}
}
})
storiesOf('UI|useSelect', module)
.add('selectMuti', () => Count, {
readme: {
sidebar: md
}
})