cl-switch 默认值问题

This commit is contained in:
神仙都没用 2024-03-22 11:01:06 +08:00
parent 893e88157f
commit a04dfc925e

View File

@ -41,15 +41,16 @@ export default defineComponent({
status.value = val;
if (val !== undefined) {
// 调整值类型
if (isBoolean(val)) {
activeValue.value = true;
inactiveValue.value = false;
} else {
activeValue.value = props.activeValue;
inactiveValue.value = props.inactiveValue;
return true;
}
}
activeValue.value = props.activeValue;
inactiveValue.value = props.inactiveValue;
},
{
immediate: true