Skip to content

Commit

Permalink
feat: 在线分享第一版-修复重复创建元素的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
terwer committed Jun 19, 2023
1 parent 7ea3c47 commit 8f9f4a3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion locales/zh_CN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default {
"share.to.web.before.tip": "向所有人发布和共享链接",
"share.to.web.after.tip": "知道链接的任何人都可以查看",
"share.copy.web.link": "复制网页链接",
"share.show.link.option": "显示链接选项",
"share.show.link.option": "链接选项",
"share.other.option": "在此处设置其他选项",
"share.other.option.link.expires": "允许链接过期",
"share.link.expires.time.placeholder": "单位/秒,最多支持7天",
Expand Down
19 changes: 2 additions & 17 deletions nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const generateDynamicV = () => {
}

const isDev = process.env.NODE_ENV === "development"
const appBase = "/plugins/siyuan-blog/"
const appBase = "/"
const staticV = generateDynamicV()

// https://nuxt.com/docs/api/configuration/nuxt-config
Expand All @@ -24,14 +24,7 @@ export default defineNuxtConfig({
},

// build modules
modules: [
"@vueuse/nuxt",
"@nuxtjs/i18n-edge",
"@element-plus/nuxt",
"@nuxtjs/color-mode",
"@pinia/nuxt",
"@nuxt/image",
],
modules: ["@vueuse/nuxt", "@nuxtjs/i18n", "@element-plus/nuxt", "@nuxtjs/color-mode", "@pinia/nuxt", "@nuxt/image"],

// vueuse
vueuse: {
Expand Down Expand Up @@ -64,14 +57,6 @@ export default defineNuxtConfig({
themes: ["dark"],
},

// https://nuxt.com/docs/guide/going-further/custom-routing#hash-mode-spa
ssr: false,
router: {
options: {
hashMode: true,
},
},

css: ["~/assets/siyuan/style.styl", "~/assets/siyuan/index.styl"],

app: {
Expand Down
6 changes: 6 additions & 0 deletions siyuan/topbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ const showPopView = (pluginInstance: SiyuanBlog, boxElement: HTMLElement, pageUr
const popContentId = "pop-content"
let popContent = document.getElementById(popContentId)

// 如果已经存在弹出框,则不需要再次创建,直接显示即可
if (popContent) {
popContent.style.opacity = "1"
return
}

// 第一次点击,创建浮动框并显示
popContent = document.createElement("div")
popContent.id = popContentId
Expand Down

0 comments on commit 8f9f4a3

Please sign in to comment.