Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions apps/web/src/components/editor/UploadImgDialog.vue
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果缺少参数是不是才应该切换 tab,配置了参数就不需要切换了吧,同理其他几个 tab 也是一样

Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@ onBeforeMount(() => {
}
})

// 当弹窗打开,且 imgHost 设为 mp 时,默认切换到公众号图床 Tab
watch(() => displayStore.isShowUploadImgDialog, (open) => {
if (open) {
const host = localStorage.getItem(`imgHost`) || imgHost.value
if (host === `mp`)
activeName.value = `mp`
}
}, { immediate: false })

function changeImgHost() {
localStorage.setItem(`imgHost`, imgHost.value)
toast.success(`图床已切换`)
Expand Down
Loading