From 1ddec3e25f59ec1f4a3830e9c35c53e861c7c6da Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Thu, 28 Apr 2022 16:48:48 +0800 Subject: [PATCH] chore: textarea confirmType default 'return' --- packages/uni-components/src/vue/textarea/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/uni-components/src/vue/textarea/index.tsx b/packages/uni-components/src/vue/textarea/index.tsx index 3069dba27..2dc301fd6 100644 --- a/packages/uni-components/src/vue/textarea/index.tsx +++ b/packages/uni-components/src/vue/textarea/index.tsx @@ -20,11 +20,15 @@ const props = /*#__PURE__*/ extend({}, fieldProps, { }, confirmType: { type: String, - default: '', + default: 'return', + validator(val: string) { + return ConfirmTypes.concat('return').includes(val) + }, }, }) let fixMargin: Boolean = false +const ConfirmTypes = ['done', 'go', 'next', 'search', 'send'] // 'return' function setFixMargin() { // iOS 13 以下版本需要修正边距 @@ -45,9 +49,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({ const { fieldRef, state, scopedAttrsState, fixDisabledColor, trigger } = useField(props, rootRef, emit) const valueCompute = computed(() => state.value.split(LINEFEED)) - const isDone = computed(() => - ['done', 'go', 'next', 'search', 'send'].includes(props.confirmType) - ) + const isDone = computed(() => ConfirmTypes.includes(props.confirmType)) const heightRef = ref(0) const lineRef: Ref = ref(null) watch( -- GitLab