|
@@ -38,6 +38,7 @@ const Fields: Record<FieldKey, Field> = {
|
|
|
control: {
|
|
|
label: '身高', placeholder: '请输入身高',
|
|
|
type: 'number', min: 1, max: 300, clearable: true, readonly: true,
|
|
|
+ maxlength: 5,
|
|
|
},
|
|
|
keyboard: { show: false, title: '身高', extraKey:'.', closeButtonText: '完成' },
|
|
|
suffix: 'cm',
|
|
@@ -46,10 +47,20 @@ const Fields: Record<FieldKey, Field> = {
|
|
|
control: {
|
|
|
label: '体重', placeholder: '请输入体重',
|
|
|
type: 'number', min: 1, max: 300, clearable: true, readonly: true,
|
|
|
+ maxlength: 5,
|
|
|
},
|
|
|
keyboard: { show: false, title: '体重', extraKey:'.', closeButtonText: '完成' },
|
|
|
suffix: 'kg',
|
|
|
},
|
|
|
+ age: {
|
|
|
+ control: {
|
|
|
+ label: '年龄', placeholder: '请输入年龄',
|
|
|
+ type: 'digit', min: 0, max: 300, clearable: true, readonly: true,
|
|
|
+ maxlength: 3,
|
|
|
+ },
|
|
|
+ keyboard: { show: false, title: '年龄', closeButtonText: '完成' },
|
|
|
+ suffix: '岁',
|
|
|
+ },
|
|
|
sex: {
|
|
|
control: { label: '性别', border: false },
|
|
|
component: {
|
|
@@ -205,6 +216,12 @@ const { send: handle } = useRequest(
|
|
|
Notify.warning(`[路由] 配置异常无法解析正确路径,请联系管理员`);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+function fix(key: FieldKey) {
|
|
|
+ for ( const field of fields.value ) {
|
|
|
+ if (field.keyboard?.show && field.name !== key ) field.keyboard.show = false;
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
<template>
|
|
|
<div>
|
|
@@ -246,7 +263,7 @@ const { send: handle } = useRequest(
|
|
|
<van-password-input
|
|
|
style="width: 100%;"
|
|
|
v-model:value="modelRef[field.name]" v-bind="(field.component as any)!.props"
|
|
|
- :focused="field.keyboard?.show" @focus="field.keyboard && (field.keyboard.show = true)"
|
|
|
+ :focused="field.keyboard?.show" @focus="field.keyboard && (field.keyboard.show = true);fix('code')"
|
|
|
/>
|
|
|
</template>
|
|
|
<template #button>
|
|
@@ -342,6 +359,10 @@ const { send: handle } = useRequest(
|
|
|
$size: 40px;
|
|
|
height: $size + 2px;
|
|
|
|
|
|
+ &::after {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
li {
|
|
|
height: $size;
|
|
|
width: $size;
|