fix: extract testScene window.open to method to avoid template scope issue
This commit is contained in:
@@ -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" />
|
||||
|
||||
Reference in New Issue
Block a user