This commit is contained in:
神仙都没用 2024-02-28 12:44:23 +08:00
parent e3cd18d991
commit b5bc3e0122

View File

@ -60,7 +60,10 @@ export default defineComponent({
function onChange(val: boolean | string | number) { function onChange(val: boolean | string | number) {
if (props.column && props.scope) { if (props.column && props.scope) {
if (val !== undefined) { if (val !== undefined) {
if (val === activeValue.value || val === inactiveValue.value) { if (
status.value === activeValue.value ||
status.value === inactiveValue.value
) {
const params = { const params = {
id: props.scope.id, id: props.scope.id,
[props.column.property]: val [props.column.property]: val
@ -95,7 +98,7 @@ export default defineComponent({
return () => { return () => {
return ( return (
<el-switch <el-switch
v-model={status.value} model-value={status.value}
active-value={activeValue.value} active-value={activeValue.value}
inactive-value={inactiveValue.value} inactive-value={inactiveValue.value}
onChange={onChange} onChange={onChange}