Initial commit

This commit is contained in:
南宁网宿科技
2024-04-24 16:36:46 +08:00
commit 121348e011
991 changed files with 158700 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import { reactive } from 'vue';
/**
* 搜索表单 hook
* @param initValue 默认值
*/
export default function <T extends object>(initValue?: T) {
const where = reactive<T>({ ...initValue } as T);
const resetFields = () => {
Object.keys(where).forEach((key) => {
where[key] = initValue ? initValue[key] : void 0;
});
};
const assignFields = (data: object) => {
Object.keys(where).forEach((key) => {
where[key] = data[key];
});
};
return {
where,
resetFields,
assignFields
};
}