fix: extract testScene window.open to method to avoid template scope issue

This commit is contained in:
2026-06-14 19:33:54 +08:00
parent 0c59e54a2a
commit 669a652ec7

View File

@@ -48,6 +48,10 @@ function importJSON() {
fileInputRef.value?.click()
}
function testScene(id: string) {
window.open('/?scene=' + id, '_blank')
}
async function onFileSelected(e: Event) {
const file = (e.target as HTMLInputElement).files?.[0]
if (!file) return
@@ -116,7 +120,7 @@ onMounted(() => loadDemo())
:selected-node-id="store.selectedNodeId"
@select-node="store.selectedNodeId = $event"
@add-edge="editor.onAddEdge"
@test-scene="(id: string) => window.open('/index.html?scene=' + id, '_blank')"
@test-scene="testScene"
/>
<div v-else-if="loading" class="loading-hint">加载剧情数据</div>
<PreviewPanel v-if="showPreview" :video-url="previewVideoUrl" />