mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-10-31 22:57:15 +08:00 
			
		
		
		
	refactor: 彻底删除 useForm 组合函数
This commit is contained in:
		| @@ -3,7 +3,6 @@ export * from './modules/usePagination' | ||||
| export * from './modules/useRequest' | ||||
| export * from './modules/useChart' | ||||
| export * from './modules/useTable' | ||||
| export * from './modules/useForm' | ||||
| export * from './modules/useDevice' | ||||
| export * from './modules/useBreakpoint' | ||||
| export * from './modules/useDownload' | ||||
|   | ||||
| @@ -1,17 +0,0 @@ | ||||
| import { reactive } from 'vue' | ||||
| import { cloneDeep } from 'lodash-es' | ||||
|  | ||||
| export function useForm<F extends object>(initValue: F) { | ||||
|   const getInitValue = () => cloneDeep(initValue) | ||||
|  | ||||
|   const form = reactive(getInitValue()) | ||||
|  | ||||
|   const resetForm = () => { | ||||
|     for (const key in form) { | ||||
|       delete form[key] | ||||
|     } | ||||
|     Object.assign(form, getInitValue()) | ||||
|   } | ||||
|  | ||||
|   return { form, resetForm } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user