From 58fd2a252837c782bc92c15d025d5a64f9ead7b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A6=99=E7=A0=81=E7=94=9F=E8=8A=B1?= <18523774412@qq.com> Date: Sat, 29 Jun 2024 16:07:50 +0800 Subject: [PATCH] =?UTF-8?q?refactor(baInput):=E8=B0=83=E6=95=B4=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=AE=9A=E4=B9=89=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/components/baInput/index.ts | 2 +- web/src/components/baInput/index.vue | 4 ++-- web/src/components/formItem/index.vue | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/src/components/baInput/index.ts b/web/src/components/baInput/index.ts index 30edcc62..f383a971 100644 --- a/web/src/components/baInput/index.ts +++ b/web/src/components/baInput/index.ts @@ -30,7 +30,7 @@ export const inputTypes = [ 'icon', 'color', ] -export type modelValueTypes = string | number | boolean | object +export type ModelValueTypes = string | number | boolean | object export interface InputData { // 内容,比如radio的选项列表数据,格式为对象或者数组:{ a: '选项1', b: '选项2' } or [{value: 1, label: 2, disabled: false}, {...}] diff --git a/web/src/components/baInput/index.vue b/web/src/components/baInput/index.vue index e2487e9e..40813386 100644 --- a/web/src/components/baInput/index.vue +++ b/web/src/components/baInput/index.vue @@ -3,7 +3,7 @@ import { isArray } from 'lodash-es' import type { PropType, VNode } from 'vue' import { computed, createVNode, defineComponent, reactive, resolveComponent } from 'vue' import { getArea } from '/@/api/common' -import type { InputAttr, InputData, modelValueTypes } from '/@/components/baInput' +import type { InputAttr, InputData, ModelValueTypes } from '/@/components/baInput' import { inputTypes } from '/@/components/baInput' import Array from '/@/components/baInput/components/array.vue' import BaUpload from '/@/components/baInput/components/baUpload.vue' @@ -44,7 +44,7 @@ export default defineComponent({ const attrs = { ...props.attr, ...props.data } // 通用值更新函数 - const onValueUpdate = (value: modelValueTypes) => { + const onValueUpdate = (value: ModelValueTypes) => { emit('update:modelValue', value) } diff --git a/web/src/components/formItem/index.vue b/web/src/components/formItem/index.vue index cb3f9850..b0b28e66 100644 --- a/web/src/components/formItem/index.vue +++ b/web/src/components/formItem/index.vue @@ -2,7 +2,7 @@ import { formItemProps } from 'element-plus' import type { PropType, VNode } from 'vue' import { createVNode, defineComponent, resolveComponent } from 'vue' -import type { InputAttr, InputData, modelValueTypes } from '/@/components/baInput' +import type { InputAttr, InputData, ModelValueTypes } from '/@/components/baInput' import { inputTypes } from '/@/components/baInput' import BaInput from '/@/components/baInput/index.vue' import type { FormItemAttr } from '/@/components/formItem' @@ -59,7 +59,7 @@ export default defineComponent({ } } - const onValueUpdate = (value: modelValueTypes) => { + const onValueUpdate = (value: ModelValueTypes) => { emit('update:modelValue', value) }