UNPKG

@fesjs/fes-design

Version:
23 lines (20 loc) 438 B
import { ref, computed } from 'vue'; const useOptionsFilter = _ref => { let { options, filter, rootProps } = _ref; const filterText = ref(''); const displayOptions = computed(() => { if (!rootProps.filterable) { return options.value; } return options.value.filter(option => filter(filterText.value, option)); }); return { filterText, displayOptions }; }; export { useOptionsFilter };