mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-11 14:45:10 +08:00
fix(form): fieldset初始化时就触发了change事件
This commit is contained in:
parent
ea4af425f3
commit
982cc4685e
@ -10,6 +10,7 @@
|
||||
:prop="`${prop}${prop ? '.' : ''}${config.name}.value`"
|
||||
:true-label="1"
|
||||
:false-label="0"
|
||||
@update:modelValue="change"
|
||||
><span v-html="config.legend"></span><span v-if="config.extra" v-html="config.extra" class="m-form-tip"></span
|
||||
></TMagicCheckbox>
|
||||
</component>
|
||||
@ -61,7 +62,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup name="MFormFieldset">
|
||||
import { computed, inject, watch } from 'vue';
|
||||
import { computed, inject } from 'vue';
|
||||
|
||||
import { TMagicCheckbox } from '@tmagic/design';
|
||||
|
||||
@ -115,13 +116,5 @@ const change = () => {
|
||||
|
||||
const key = (item: any, index: number) => item[mForm?.keyProp || '__key'] ?? index;
|
||||
|
||||
if (props.config.checkbox && name.value) {
|
||||
watch(
|
||||
() => props.model[name.value]?.value,
|
||||
() => {
|
||||
emit('change', props.model);
|
||||
},
|
||||
);
|
||||
}
|
||||
const onAddDiffCount = () => emit('addDiffCount');
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user