hookehuyr

🐞 fix(单选控件): 选项值变化时需要触发自定义事件回传数值

<!--
* @Date: 2022-08-30 11:34:19
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-02-01 18:58:00
* @LastEditTime: 2023-02-10 11:04:38
* @FilePath: /data-table/src/components/RadioField/index.vue
* @Description: 单项选择控件
-->
......@@ -68,6 +68,9 @@ const affix_value = ref('');
const onChange = (item) => {
clearAffix()
// 发送自定义数据结构
props.item.value = { key: props.item.key, value: radio_value.value, affix: affix_value.value, type: "radio" };
emit("active", props.item.value);
}
const onBlur = (item) => {
clearAffix()
......@@ -86,6 +89,7 @@ const clearAffix = () => {
});
}
onMounted(() => {
radio_value.value = props.item.component_props.default ? props.item.component_props.default : '';
// 发送自定义数据结构
props.item.value = { key: props.item.key, value: radio_value.value, affix: affix_value.value, type: "radio" };
emit("active", props.item.value);
......