搜索结果列表页面开发
This commit is contained in:
18
src/utils/hooks/useModel.ts
Normal file
18
src/utils/hooks/useModel.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { SetupContext } from 'vue';
|
||||
import { computed } from 'vue';
|
||||
|
||||
export function useModel(props: any, emits: SetupContext<{
|
||||
'update:modelValue': (val: any) => void
|
||||
}>['emit']) {
|
||||
const vModels = computed({
|
||||
get() {
|
||||
return props.modelValue;
|
||||
},
|
||||
set(val) {
|
||||
emits('update:modelValue', val);
|
||||
}
|
||||
});
|
||||
return {
|
||||
vModels
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user