Showing
1 changed file
with
8 additions
and
4 deletions
| 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-02-10 10:06:43 | 4 | + * @LastEditTime: 2024-06-06 15:41:04 |
| 5 | * @FilePath: /data-table/src/components/CheckboxField/index.vue | 5 | * @FilePath: /data-table/src/components/CheckboxField/index.vue |
| 6 | * @Description: 多项选择控件 | 6 | * @Description: 多项选择控件 |
| 7 | --> | 7 | --> |
| ... | @@ -20,11 +20,15 @@ | ... | @@ -20,11 +20,15 @@ |
| 20 | <van-checkbox-group v-model="checkbox_value" :direction="item.component_props.direction" | 20 | <van-checkbox-group v-model="checkbox_value" :direction="item.component_props.direction" |
| 21 | :max="item.component_props.max" style="width: 100%"> | 21 | :max="item.component_props.max" style="width: 100%"> |
| 22 | <div v-for="x in item.component_props.options" :key="x.title" class="checkbox-wrapper"> | 22 | <div v-for="x in item.component_props.options" :key="x.title" class="checkbox-wrapper"> |
| 23 | - <van-checkbox @click="onClick(x)" :name="x.title" icon-size="1rem" shape="square" | 23 | + <div v-if="item.component_props.readonly"> |
| 24 | + <div v-if="item.component_props.default.includes(x.value)" role="checkbox" class="van-checkbox van-checkbox--vertical" tabindex="0" aria-checked="true" data-v-3722f8ba="" style="margin-bottom: 0.25rem;"><div class="van-checkbox__icon van-checkbox__icon--square van-checkbox__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-checkbox__label">{{ x.title }}</span></div> | ||
| 25 | + <div v-else role="checkbox" class="van-checkbox van-checkbox--vertical" tabindex="0" aria-checked="false" data-v-3722f8ba="" style="margin-bottom: 0.25rem;"><div class="van-checkbox__icon van-checkbox__icon--square" style="font-size: 1rem;"><i class="van-badge__wrapper van-icon van-icon-success" style=""><!----><!----><!----></i></div><span class="van-checkbox__label">{{ x.title }}</span></div> | ||
| 26 | + </div> | ||
| 27 | + <van-checkbox v-else @click="onClick(x)" :name="x.title" icon-size="1rem" shape="square" | ||
| 24 | :checked-color="themeVars.radioColor" style="margin-bottom: 0.25rem">{{ x.title }}</van-checkbox> | 28 | :checked-color="themeVars.radioColor" style="margin-bottom: 0.25rem">{{ x.title }}</van-checkbox> |
| 25 | - <van-field v-if="checkbox_value.includes(x.value) && x.is_input" @blur="onBlur(x)" v-model="x.affix" | 29 | + <van-field v-if="checkbox_value.includes(x.value) && x.is_input && (item.component_props.readonly && x.affix)" @blur="onBlur(x)" v-model="x.affix" |
| 26 | label=" " label-width="5px" :placeholder="x.input_placeholder" :rules="x.input_required ? rules : ''" | 30 | label=" " label-width="5px" :placeholder="x.input_placeholder" :rules="x.input_required ? rules : ''" |
| 27 | - :required="x.input_required" class="affix-input" /> | 31 | + :required="x.input_required" :readonly="item.component_props.readonly" class="affix-input" /> |
| 28 | </div> | 32 | </div> |
| 29 | </van-checkbox-group> | 33 | </van-checkbox-group> |
| 30 | </template> | 34 | </template> | ... | ... |
-
Please register or login to post a comment