Skip to content

Commit eb580f6

Browse files
committed
fix: 修复计划名单添加操作异常
1 parent dff9889 commit eb580f6

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

components/dynamic-input.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default defineComponent({
99
const syncing = ref(false)
1010
const syncId = ref(0)
1111

12-
watchImmediate(propsValue, async (v) => {
12+
watch(propsValue, async (v) => {
1313
syncing.value = true
1414
const id = ++syncId.value
1515
const origin = toRaw(v) ?? []
@@ -24,7 +24,7 @@ export default defineComponent({
2424
if (id !== syncId.value) // 有新的更新
2525
return
2626
}
27-
})
27+
}, { immediate: true, deep: true }) // 如果不深度监听,字符串变化不会触发更新
2828

2929
return () => (
3030
<NDynamicInput

components/settings/plan.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ onBeforeUnmount(() => { // 保存设置
2626
v-model:value="queue"
2727
:max="MAX_PLAN_QUEUE_SIZE"
2828
#="{ index }: { index: number }"
29-
@remove="(index) => queue.splice(index, 1)"
3029
>
3130
<NSelect
3231
v-model:value="queue[index]"

0 commit comments

Comments
 (0)