修复: 首页文库打开/新建空白后不切入编辑器
This commit is contained in:
@@ -254,6 +254,7 @@ onUnmounted(() => {
|
|||||||
@close="libraryVisible = false"
|
@close="libraryVisible = false"
|
||||||
@toast="toast"
|
@toast="toast"
|
||||||
@switch-tab="(t: string) => switchTab(t as 'props' | 'ai')"
|
@switch-tab="(t: string) => switchTab(t as 'props' | 'ai')"
|
||||||
|
@open-deck="mode = 'editor'"
|
||||||
/>
|
/>
|
||||||
<TemplateModal
|
<TemplateModal
|
||||||
:visible="templateVisible"
|
:visible="templateVisible"
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ const emit = defineEmits<{
|
|||||||
(e: 'close'): void
|
(e: 'close'): void
|
||||||
(e: 'toast', msg: string): void
|
(e: 'toast', msg: string): void
|
||||||
(e: 'switch-tab', tab: string): void
|
(e: 'switch-tab', tab: string): void
|
||||||
|
(e: 'open-deck'): void
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const libVersion = ref(0)
|
const libVersion = ref(0)
|
||||||
@@ -77,6 +78,7 @@ function onSave() {
|
|||||||
function onNewBlank() {
|
function onNewBlank() {
|
||||||
store.newBlankDeck()
|
store.newBlankDeck()
|
||||||
emit('switch-tab', 'props')
|
emit('switch-tab', 'props')
|
||||||
|
emit('open-deck')
|
||||||
toast('已新建空白演示,在右侧添加元素')
|
toast('已新建空白演示,在右侧添加元素')
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
@@ -84,6 +86,7 @@ function onNewBlank() {
|
|||||||
function onOpen(id: string) {
|
function onOpen(id: string) {
|
||||||
if (store.loadFromLibrary(id)) {
|
if (store.loadFromLibrary(id)) {
|
||||||
toast('已打开')
|
toast('已打开')
|
||||||
|
emit('open-deck')
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user