From 986da22689dc9a5faef751c02348fb1f47584414 Mon Sep 17 00:00:00 2001 From: cuiqian2004 <cuiqian2004@163.com> Date: 星期五, 21 三月 2025 18:53:01 +0800 Subject: [PATCH] Merge branch 'master' of http://121.37.118.194:8000/r/~jt/MES-PDA --- components/oi-form/list/switch/index.vue | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/oi-form/list/switch/index.vue b/components/oi-form/list/switch/index.vue index 61be119..45adb7f 100644 --- a/components/oi-form/list/switch/index.vue +++ b/components/oi-form/list/switch/index.vue @@ -2,8 +2,8 @@ <view class="oi-form-switch"> <!-- Switch寮�叧 --> <switch v-if="model" :class="data.disabled?'input-disabled':''" :disabled="data.disabled" - v-model="model[data.fieldId]" @change="onChange" /> - <switch v-else :class="data.disabled?'input-disabled':''" :disabled="data.disabled" v-model="data.value" + :checked="model[data.fieldId]" @change="onChange" /> + <switch v-else :class="data.disabled?'input-disabled':''" :disabled="data.disabled" checked="data.value" @change="onChange" /> </view> </template> @@ -20,7 +20,11 @@ }, methods: { onChange(e) { - this.$emit("change", e) + this.data.value = e.detail.value + if (this.model) + this.model[this.data.fieldId] = e.detail.value + + this.$emit("on-change", e) }, -- Gitblit v1.9.1