From 8c33b2b2f3bf20f385c001c56f861831e8ce4510 Mon Sep 17 00:00:00 2001 From: zq <136432190602163.com> Date: Thu, 19 Jun 2025 11:42:43 +0800 Subject: [PATCH] =?UTF-8?q?radio=E3=80=81select=E7=BB=84=E4=BB=B6=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=BF=85=E8=BE=93=E6=A0=87=E8=AF=86=EF=BC=9Bloading?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/GlobalLoading1.vue | 106 ++++++++++++------------ src/components/GuipRadio.vue | 166 +++++++++++++++++++------------------- src/components/GuipSelect.vue | 3 +- 3 files changed, 139 insertions(+), 136 deletions(-) diff --git a/src/components/GlobalLoading1.vue b/src/components/GlobalLoading1.vue index 50e8cdc..0b632f3 100644 --- a/src/components/GlobalLoading1.vue +++ b/src/components/GlobalLoading1.vue @@ -1,67 +1,69 @@ - diff --git a/src/components/GuipRadio.vue b/src/components/GuipRadio.vue index bfbdb64..b31d6cb 100644 --- a/src/components/GuipRadio.vue +++ b/src/components/GuipRadio.vue @@ -1,88 +1,88 @@ - - - - - \ No newline at end of file + // 表单项的 label + label: { + type: String, + default: '', + }, + // 表单项的 prop(用于表单校验) + prop: { + type: String, + default: '', + }, + // 校验规则 + rules: { + type: Array, + default: () => [], + }, + }, + data() { + return { + selectedValue: this.value, // 内部维护的选中值 + }; + }, + watch: { + // 监听外部传入的 value 变化,更新内部 selectedValue + value(newVal) { + this.selectedValue = newVal; + }, + }, + methods: { + // 选中值变化时触发 + handleChange(value) { + this.$emit('input', value); // 更新 v-model + this.$emit('change', value); // 触发 change 事件 + }, + }, +}; + + + \ No newline at end of file diff --git a/src/components/GuipSelect.vue b/src/components/GuipSelect.vue index 7de9967..0c30538 100644 --- a/src/components/GuipSelect.vue +++ b/src/components/GuipSelect.vue @@ -1,5 +1,5 @@