mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
chore(Checkbox): remove checked setter
This commit is contained in:
parent
9e9f0e3d4d
commit
9aabb42f9d
@ -46,24 +46,19 @@ export default createComponent({
|
||||
}
|
||||
};
|
||||
|
||||
const checked = computed({
|
||||
get() {
|
||||
if (parent) {
|
||||
return parent.props.modelValue.indexOf(props.name) !== -1;
|
||||
}
|
||||
return props.modelValue;
|
||||
},
|
||||
set(value) {
|
||||
if (parent) {
|
||||
setParentValue(value);
|
||||
} else {
|
||||
emit('update:modelValue', value);
|
||||
}
|
||||
},
|
||||
const checked = computed(() => {
|
||||
if (parent) {
|
||||
return parent.props.modelValue.indexOf(props.name) !== -1;
|
||||
}
|
||||
return props.modelValue;
|
||||
});
|
||||
|
||||
const toggle = (newValue = !checked.value) => {
|
||||
checked.value = newValue;
|
||||
if (parent) {
|
||||
setParentValue(newValue);
|
||||
} else {
|
||||
emit('update:modelValue', newValue);
|
||||
}
|
||||
};
|
||||
|
||||
watch(
|
||||
|
@ -157,7 +157,6 @@ export default createComponent({
|
||||
if (slots.default) {
|
||||
return slots.default();
|
||||
}
|
||||
|
||||
if (props.text) {
|
||||
return <div class={bem('text')}>{props.text}</div>;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user