From 58146dc7b7d9e92f96f1dce7eb0f107053f4cbd4 Mon Sep 17 00:00:00 2001 From: Eiinu Date: Tue, 23 Jan 2024 23:43:20 +0800 Subject: [PATCH] chore(number-keyboard): improve type def (#2868) --- src/packages/__VUE/numberkeyboard/index.taro.vue | 3 ++- src/packages/__VUE/numberkeyboard/index.vue | 3 ++- src/packages/__VUE/numberkeyboard/types.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 src/packages/__VUE/numberkeyboard/types.ts diff --git a/src/packages/__VUE/numberkeyboard/index.taro.vue b/src/packages/__VUE/numberkeyboard/index.taro.vue index 2dafedbffe..7b4582bc34 100644 --- a/src/packages/__VUE/numberkeyboard/index.taro.vue +++ b/src/packages/__VUE/numberkeyboard/index.taro.vue @@ -81,6 +81,7 @@ import { computed, ref, watch, Ref, PropType } from 'vue'; import { createComponent } from '@/packages/utils/create'; import NutPopup from '../popup/index.taro.vue'; import { useLocale } from '@/packages/utils/useLocale'; +import { NumberKeyboardType } from './types'; const { create } = createComponent('number-keyboard'); export interface keys { id: number | string; @@ -105,7 +106,7 @@ export default create({ default: false }, type: { - type: String, + type: String as PropType, default: 'default' }, customKey: { diff --git a/src/packages/__VUE/numberkeyboard/index.vue b/src/packages/__VUE/numberkeyboard/index.vue index e6740858c3..26d423cdfe 100644 --- a/src/packages/__VUE/numberkeyboard/index.vue +++ b/src/packages/__VUE/numberkeyboard/index.vue @@ -81,6 +81,7 @@ import { computed, ref, watch, Ref, PropType } from 'vue'; import { createComponent } from '@/packages/utils/create'; import NutPopup from '../popup/index.vue'; import { useLocale } from '@/packages/utils/useLocale'; +import { NumberKeyboardType } from './types'; const { create } = createComponent('number-keyboard'); export interface keys { id: number | string; @@ -105,7 +106,7 @@ export default create({ default: false }, type: { - type: String, + type: String as PropType, default: 'default' }, customKey: { diff --git a/src/packages/__VUE/numberkeyboard/types.ts b/src/packages/__VUE/numberkeyboard/types.ts new file mode 100644 index 0000000000..b8aa558497 --- /dev/null +++ b/src/packages/__VUE/numberkeyboard/types.ts @@ -0,0 +1 @@ +export type NumberKeyboardType = 'default' | 'rightColumn';