hookehuyr

邮箱性别身份证组件默认值和只读显示

...@@ -33,6 +33,9 @@ const props = defineProps({ ...@@ -33,6 +33,9 @@ const props = defineProps({
33 const HideShow = computed(() => { 33 const HideShow = computed(() => {
34 return !props.item.component_props.disabled 34 return !props.item.component_props.disabled
35 }) 35 })
36 +onMounted(() => {
37 + props.item.value = props.item.component_props.default;
38 +})
36 const required = props.item.component_props.required; 39 const required = props.item.component_props.required;
37 const validator = (val) => { 40 const validator = (val) => {
38 if (required && !val) { 41 if (required && !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: 2023-12-19 16:05:16 4 + * @LastEditTime: 2024-06-06 18:18:11
5 * @FilePath: /data-table/src/components/GenderField/index.vue 5 * @FilePath: /data-table/src/components/GenderField/index.vue
6 * @Description: 性别选择控件 6 * @Description: 性别选择控件
7 --> 7 -->
...@@ -21,7 +21,11 @@ ...@@ -21,7 +21,11 @@
21 <template #input> 21 <template #input>
22 <van-radio-group @change="onChange(item)" v-model="gender_value" :direction="item.component_props.direction" style="width: 100%"> 22 <van-radio-group @change="onChange(item)" v-model="gender_value" :direction="item.component_props.direction" style="width: 100%">
23 <div v-for="x in item.component_props.options" :key="x.value" class="radio-wrapper"> 23 <div v-for="x in item.component_props.options" :key="x.value" class="radio-wrapper">
24 - <van-radio :name="x.value" icon-size="1rem" :checked-color="themeVars.radioColor" 24 + <div v-if="item.component_props.readonly" class="readonly-show">
25 + <div v-if="item.component_props.default === x.value" role="radio" class="van-radio van-radio--vertical" tabindex="0" aria-checked="true" data-v-04873bb2="" style="margin-bottom: 0.25rem;"><div class="van-radio__icon van-radio__icon--round van-radio__icon--checked" style="font-size: 1rem;"><i class="van-badge__wrapper van-icon van-icon-success" style="border-color: rgb(194, 145, 95); background-color: rgb(194, 145, 95);"><!----><!----><!----></i></div><span class="van-radio__label">{{ x.title }}</span></div>
26 + <div v-else role="radio" class="van-radio van-radio--vertical" tabindex="0" aria-checked="false" data-v-04873bb2="" style="margin-bottom: 0.25rem;"><div class="van-radio__icon van-radio__icon--round" style="font-size: 1rem;"><i class="van-badge__wrapper van-icon van-icon-success"><!----><!----><!----></i></div><span class="van-radio__label">{{ x.title }}</span></div>
27 + </div>
28 + <van-radio v-else :name="x.value" icon-size="1rem" :checked-color="themeVars.radioColor"
25 style="margin-bottom: 0.25rem">{{ x.title }}</van-radio> 29 style="margin-bottom: 0.25rem">{{ x.title }}</van-radio>
26 </div> 30 </div>
27 </van-radio-group> 31 </van-radio-group>
......
1 <!-- 1 <!--
2 * @Date: 2022-09-14 14:44:30 2 * @Date: 2022-09-14 14:44:30
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2024-04-08 17:59:03 4 + * @LastEditTime: 2024-06-06 18:17:34
5 * @FilePath: /data-table/src/components/IdentityField/index.vue 5 * @FilePath: /data-table/src/components/IdentityField/index.vue
6 * @Description: 身份证输入控件 6 * @Description: 身份证输入控件
7 --> 7 -->
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
35 :placeholder="item.component_props.placeholder" 35 :placeholder="item.component_props.placeholder"
36 :rules="rules" 36 :rules="rules"
37 :required="item.component_props.required" 37 :required="item.component_props.required"
38 - :disabled="item.component_props.readonly" 38 + :readonly="item.component_props.readonly"
39 :border="false" 39 :border="false"
40 > 40 >
41 </van-field> 41 </van-field>
...@@ -65,6 +65,9 @@ const props = defineProps({ ...@@ -65,6 +65,9 @@ const props = defineProps({
65 // 隐藏显示 65 // 隐藏显示
66 const HideShow = computed(() => { 66 const HideShow = computed(() => {
67 return !props.item.component_props.disabled 67 return !props.item.component_props.disabled
68 +});
69 +onMounted(() => {
70 + props.item.value = props.item.component_props.default;
68 }) 71 })
69 const show = ref(false); 72 const show = ref(false);
70 let content = ""; 73 let content = "";
......