hookehuyr

单选多选控件新增描述属性显示

<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-11-21 14:42:00
* @LastEditTime: 2022-12-22 11:35:38
* @FilePath: /data-table/src/components/CheckboxField/index.vue
* @Description: 多项选择控件
-->
......@@ -14,6 +14,9 @@
(最多可选数:&nbsp;{{ item.component_props.max }})
</span>
</div>
<div v-if="item.component_props.note" class="note">
{{ item.component_props.note }}
</div>
<van-field :name="item.key" :rules="item.rules" :border="false">
<template #input>
<van-checkbox-group
......@@ -24,13 +27,13 @@
>
<van-checkbox
v-for="x in item.component_props.options"
:key="index"
:name="x"
:key="x.value"
:name="x.value"
icon-size="1rem"
shape="square"
:checked-color="themeVars.radioColor"
style="margin-bottom: 0.25rem"
>{{ x }}</van-checkbox
>{{ x.title }}</van-checkbox
>
</van-checkbox-group>
</template>
......@@ -61,6 +64,12 @@ onMounted(() => {
font-size: 0.9rem;
font-weight: bold;
}
.note {
font-size: 0.9rem;
margin-left: 1rem;
color: gray;
padding-bottom: 0.5rem
}
}
:deep(.van-checkbox) {
......
<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2022-12-19 10:47:56
* @LastEditTime: 2022-12-22 11:31:31
* @FilePath: /data-table/src/components/RadioField/index.vue
* @Description: 单项选择控件
-->
......@@ -11,10 +11,7 @@
{{ item.component_props.label
}}<span v-if="item.component_props.required">&nbsp;*</span>
</div>
<div
v-if="item.component_props.note"
style="font-size: 0.9rem; margin-left: 1rem; color: gray; margin-top: 0.25rem;"
>
<div v-if="item.component_props.note" class="note">
{{ item.component_props.note }}
</div>
<van-field :name="item.key" :rules="item.rules">
......@@ -62,6 +59,12 @@ const themeVars = {
color: red;
}
}
.note {
font-size: 0.9rem;
margin-left: 1rem;
color: gray;
padding-bottom: 0.5rem
}
}
:deep(.van-radio) {
......