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 @@