From 3e52e3ff72b17c36b8e684a083a916bfffea81d8 Mon Sep 17 00:00:00 2001 From: chenjie <540053866@qq.com> Date: Sun, 3 Apr 2022 17:30:32 +0800 Subject: [PATCH 1/6] perf(ui/inpuit): add class --- packages/varlet-ui/src/form/Form.vue | 6 +- packages/varlet-ui/src/input/Input.vue | 105 +++++++++++++------------ 2 files changed, 59 insertions(+), 52 deletions(-) diff --git a/packages/varlet-ui/src/form/Form.vue b/packages/varlet-ui/src/form/Form.vue index 3d216459a88..221325ab6fb 100644 --- a/packages/varlet-ui/src/form/Form.vue +++ b/packages/varlet-ui/src/form/Form.vue @@ -1,5 +1,5 @@ @@ -10,6 +10,9 @@ import { props } from './props' import { useFormItems } from './provide' import type { ComputedRef } from 'vue' import type { FormProvider } from './provide' +import { createNamespace } from '../utils/components' + +const { n } = createNamespace('form') export default defineComponent({ name: 'VarForm', @@ -40,6 +43,7 @@ export default defineComponent({ bindFormItems(formProvider) return { + n, validate, reset, resetValidation, diff --git a/packages/varlet-ui/src/input/Input.vue b/packages/varlet-ui/src/input/Input.vue index d8d89c941b1..394fb09fbb2 100644 --- a/packages/varlet-ui/src/input/Input.vue +++ b/packages/varlet-ui/src/input/Input.vue @@ -1,24 +1,33 @@