UNPKG

@tplc/business

Version:

17 lines (15 loc) 513 B
import { Ref, inject } from 'vue' import { LIST_FORM_CHOOSER_VALUES } from '../../../constants' import { ListFormChooserValues, Option } from '../types' const useSyncValues = () => { const listFormChooserValues = inject(LIST_FORM_CHOOSER_VALUES) as Ref<ListFormChooserValues> const syncValues = (valueName: string, options?: Option[], sortType?: boolean) => { if (!sortType) { listFormChooserValues.value[valueName] = options } } return { syncValues, } } export default useSyncValues