hookehuyr

新增组件默认值,单选新增字段描述属性

1 <!-- 1 <!--
2 * @Date: 2022-09-02 10:46:03 2 * @Date: 2022-09-02 10:46:03
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-12-08 17:47:30 4 + * @LastEditTime: 2022-12-09 13:34:21
5 * @FilePath: /data-table/src/components/PhoneField/index.vue 5 * @FilePath: /data-table/src/components/PhoneField/index.vue
6 * @Description: 手机输入框 6 * @Description: 手机输入框
7 --> 7 -->
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 :name="item.name" 17 :name="item.name"
18 type="digit" 18 type="digit"
19 maxlength="11" 19 maxlength="11"
20 - :placeholder="item.component_props.placeholder" 20 + :placeholder="item.component_props.placeholder ? item.component_props.placeholder : '请输入手机号码'"
21 :rules="rules" 21 :rules="rules"
22 :required="item.component_props.required" 22 :required="item.component_props.required"
23 :readonly="readonly" 23 :readonly="readonly"
...@@ -25,6 +25,20 @@ ...@@ -25,6 +25,20 @@
25 :border="false" 25 :border="false"
26 > 26 >
27 </van-field> 27 </van-field>
28 + <van-field
29 + v-if="is_sms"
30 + name="ignore"
31 + v-model="sms"
32 + center
33 + clearable
34 + label=""
35 + placeholder="请输入短信验证码"
36 + :border="false"
37 + >
38 + <template #button>
39 + <van-button size="small" type="primary">发送验证码</van-button>
40 + </template>
41 + </van-field>
28 <van-number-keyboard 42 <van-number-keyboard
29 v-model="item.value" 43 v-model="item.value"
30 :show="show" 44 :show="show"
...@@ -46,6 +60,8 @@ const props = defineProps({ ...@@ -46,6 +60,8 @@ const props = defineProps({
46 60
47 // web端判断 61 // web端判断
48 const readonly = computed(() => wxInfo().isMobile); 62 const readonly = computed(() => wxInfo().isMobile);
63 +// 打开短信验证模式
64 +const is_sms = ref(false);
49 65
50 // 校验函数返回 true 表示校验通过,false 表示不通过 66 // 校验函数返回 true 表示校验通过,false 表示不通过
51 const validator = (val) => { 67 const validator = (val) => {
......
1 <!-- 1 <!--
2 * @Date: 2022-08-30 11:34:19 2 * @Date: 2022-08-30 11:34:19
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-11-21 15:15:51 4 + * @LastEditTime: 2022-12-09 15:54:52
5 * @FilePath: /data-table/src/components/RadioField/index.vue 5 * @FilePath: /data-table/src/components/RadioField/index.vue
6 * @Description: 单项选择控件 6 * @Description: 单项选择控件
7 --> 7 -->
...@@ -11,6 +11,12 @@ ...@@ -11,6 +11,12 @@
11 {{ item.component_props.label 11 {{ item.component_props.label
12 }}<span v-if="item.component_props.required">&nbsp;*</span> 12 }}<span v-if="item.component_props.required">&nbsp;*</span>
13 </div> 13 </div>
14 + <div
15 + v-if="item.component_props.note"
16 + style="font-size: 0.9rem; margin-left: 1rem; color: gray; margin-top: 0.25rem;"
17 + >
18 + {{ item.component_props.note }}
19 + </div>
14 <van-field :name="item.key" :rules="item.rules"> 20 <van-field :name="item.key" :rules="item.rules">
15 <template #input> 21 <template #input>
16 <van-radio-group 22 <van-radio-group
......
1 <!-- 1 <!--
2 * @Date: 2022-08-29 14:31:20 2 * @Date: 2022-08-29 14:31:20
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-09-13 18:13:21 4 + * @LastEditTime: 2022-12-09 15:33:56
5 * @FilePath: /data-table/src/components/TextField/index.vue 5 * @FilePath: /data-table/src/components/TextField/index.vue
6 * @Description: 单行文本输入框 6 * @Description: 单行文本输入框
7 --> 7 -->
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 v-model="item.value" 15 v-model="item.value"
16 :name="item.name" 16 :name="item.name"
17 :type="item.type" 17 :type="item.type"
18 - :placeholder="item.component_props.placeholder" 18 + :placeholder="item.component_props.placeholder ? item.component_props.placeholder : '请输入'"
19 :rules="item.rules" 19 :rules="item.rules"
20 :required="item.required" 20 :required="item.required"
21 :readonly="item.component_props.readonly" 21 :readonly="item.component_props.readonly"
......
1 <!-- 1 <!--
2 * @Date: 2022-08-29 14:31:20 2 * @Date: 2022-08-29 14:31:20
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2022-09-08 14:27:56 4 + * @LastEditTime: 2022-12-09 15:37:59
5 * @FilePath: /data-table/src/components/TextareaField/index.vue 5 * @FilePath: /data-table/src/components/TextareaField/index.vue
6 * @Description: 多行文本输入框 6 * @Description: 多行文本输入框
7 --> 7 -->
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
15 v-model="item.value" 15 v-model="item.value"
16 :name="item.name" 16 :name="item.name"
17 :type="item.type" 17 :type="item.type"
18 - :placeholder="item.component_props.placeholder" 18 + :placeholder="item.component_props.placeholder ? item.component_props.placeholder : '请输入'"
19 :rules="item.rules" 19 :rules="item.rules"
20 :required="item.component_props.required" 20 :required="item.component_props.required"
21 :rows="item.component_props.rows" 21 :rows="item.component_props.rows"
......