diff --git a/CHANGELOG.zh_CN.md b/CHANGELOG.zh_CN.md index 716a25e680edadb3d9c4e422b0967b3376b22039..8d93cbe0c81ff9ef04cbdefd61830d5a2861370a 100644 --- a/CHANGELOG.zh_CN.md +++ b/CHANGELOG.zh_CN.md @@ -14,6 +14,7 @@ - 修复黑暗主题刷新闪烁的白屏 - 修复标签页关闭其他功能失效问题 +- 修复表单已知问题 ## 2.3.0 (2021-04-10) diff --git a/build/vite/plugin/index.ts b/build/vite/plugin/index.ts index 498278e8650b48d951b62510a9b74e07116c5269..286b07a3f8f1f7dafba71ffdf0d76fbd07ece034 100644 --- a/build/vite/plugin/index.ts +++ b/build/vite/plugin/index.ts @@ -16,7 +16,7 @@ import { configThemePlugin } from './theme'; import { configImageminPlugin } from './imagemin'; import { configWindiCssPlugin } from './windicss'; import { configSvgIconsPlugin } from './svgSprite'; -// import { configHmrPlugin } from './hmr'; +import { configHmrPlugin } from './hmr'; export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { const { @@ -35,7 +35,7 @@ export function createVitePlugins(viteEnv: ViteEnv, isBuild: boolean) { ]; // TODO - // !isBuild && vitePlugins.push(configHmrPlugin()); + !isBuild && vitePlugins.push(configHmrPlugin()); // @vitejs/plugin-legacy VITE_LEGACY && isBuild && vitePlugins.push(legacy()); diff --git a/src/components/Form/src/hooks/useForm.ts b/src/components/Form/src/hooks/useForm.ts index 00602559e4ef316035ffc55eb571c6324e66bb81..5061f5efabb39ae66b428d84c285ff4b2e1547f8 100644 --- a/src/components/Form/src/hooks/useForm.ts +++ b/src/components/Form/src/hooks/useForm.ts @@ -77,8 +77,7 @@ export function useForm(props?: Props): UseFormReturnType { }, removeSchemaByFiled: async (field: string | string[]) => { - const form = await getForm(); - form.removeSchemaByFiled(field); + unref(formRef)?.removeSchemaByFiled(field); }, // TODO promisify diff --git a/src/components/Form/src/hooks/useFormEvents.ts b/src/components/Form/src/hooks/useFormEvents.ts index db4035b7b7b1e65235b56ba76667165d824ad5b8..8deaf0dfb8ee249519398e869343dfcd469dfa6b 100644 --- a/src/components/Form/src/hooks/useFormEvents.ts +++ b/src/components/Form/src/hooks/useFormEvents.ts @@ -88,7 +88,9 @@ export function useFormEvents({ */ async function removeSchemaByFiled(fields: string | string[]): Promise { const schemaList: FormSchema[] = cloneDeep(unref(getSchema)); - if (!fields) return; + if (!fields) { + return; + } let fieldList: string[] = isString(fields) ? [fields] : fields; if (isString(fields)) { @@ -107,6 +109,7 @@ export function useFormEvents({ if (isString(field)) { const index = schemaList.findIndex((schema) => schema.field === field); if (index !== -1) { + delete formModel[field]; schemaList.splice(index, 1); } } diff --git a/src/components/Icon/README.md b/src/components/Icon/README.md deleted file mode 100644 index 79260d3f1202c60111e33fdcd09bcce7b11c2857..0000000000000000000000000000000000000000 --- a/src/components/Icon/README.md +++ /dev/null @@ -1,7 +0,0 @@ -### `Icon.vue` - -```html - -``` - -The icon id follows the rules in [Iconify](https://iconify.design/) which you can use any icons from the supported icon sets.