fix: 修复设置器不更新问题 (#361)
This commit is contained in:
parent
591a98bff1
commit
6c396c6ec8
@ -68,7 +68,7 @@ watch(
|
|||||||
() => props.formConfig.value,
|
() => props.formConfig.value,
|
||||||
(newVal: boolean) => {
|
(newVal: boolean) => {
|
||||||
if (newVal !== modelValue.value) {
|
if (newVal !== modelValue.value) {
|
||||||
modelValue.value == !!newVal
|
modelValue.value = !!newVal
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, computed } from 'vue'
|
import { ref, computed, watch } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import 'element-plus/theme-chalk/src/message.scss'
|
import 'element-plus/theme-chalk/src/message.scss'
|
||||||
import { FORM_CHANGE_EVENT_KEY } from '@/materials/setters/constant'
|
import { FORM_CHANGE_EVENT_KEY } from '@/materials/setters/constant'
|
||||||
@ -65,6 +65,17 @@ const handleInputChange = (value: number) => {
|
|||||||
|
|
||||||
emit(FORM_CHANGE_EVENT_KEY, { key, value })
|
emit(FORM_CHANGE_EVENT_KEY, { key, value })
|
||||||
}
|
}
|
||||||
|
watch(
|
||||||
|
() => props.formConfig.value,
|
||||||
|
(newVal) => {
|
||||||
|
if (newVal !== modelValue.value) {
|
||||||
|
modelValue.value = newVal
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
immediate: true
|
||||||
|
}
|
||||||
|
)
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.star-form.star-form_horizon {
|
.star-form.star-form_horizon {
|
||||||
|
Loading…
Reference in New Issue
Block a user