fix: 修复设置器不更新问题 (#361)

This commit is contained in:
dayou 2024-07-23 15:39:43 +08:00 committed by sudoooooo
parent 591a98bff1
commit 6c396c6ec8
2 changed files with 13 additions and 2 deletions

View File

@ -68,7 +68,7 @@ watch(
() => props.formConfig.value,
(newVal: boolean) => {
if (newVal !== modelValue.value) {
modelValue.value == !!newVal
modelValue.value = !!newVal
}
},
{

View File

@ -8,7 +8,7 @@
/>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { ref, computed, watch } from 'vue'
import { ElMessage } from 'element-plus'
import 'element-plus/theme-chalk/src/message.scss'
import { FORM_CHANGE_EVENT_KEY } from '@/materials/setters/constant'
@ -65,6 +65,17 @@ const handleInputChange = (value: number) => {
emit(FORM_CHANGE_EVENT_KEY, { key, value })
}
watch(
() => props.formConfig.value,
(newVal) => {
if (newVal !== modelValue.value) {
modelValue.value = newVal
}
},
{
immediate: true
}
)
</script>
<style lang="scss" scoped>
.star-form.star-form_horizon {