fix: key AppSheet render branches and self-heal never-mounted component vnodes
ci / gitleaks (push) Successful in 8s
ci / docker (push) Successful in 6m50s

This commit is contained in:
2026-09-23 11:12:43 +08:00
parent 2239cd4754
commit a64b7b8262
4 changed files with 39 additions and 6 deletions
+8
View File
@@ -1,4 +1,5 @@
import { afterEach, describe, expect, it, vi } from 'vitest'
import { readFileSync } from 'node:fs'
import { createApp, h, nextTick, ref } from 'vue'
import AppSheet from './AppSheet.vue'
import AppDialog from './AppDialog.vue'
@@ -273,4 +274,11 @@ describe('AppSheet', () => {
await nextTick()
expect(calls).toEqual(['two'])
})
it('keys each render branch so modal/inline/bare switches remount instead of cross-patching', () => {
const source = readFileSync('src/components/AppSheet.vue', 'utf8')
expect(source).toContain(`:key="'app-sheet-modal'"`)
expect(source).toContain(`:key="'app-sheet-inline'"`)
expect(source).toContain(`:key="'app-sheet-bare'"`)
})
})