fix: 修复“敬请期待”展示问题
This commit is contained in:
parent
37f2f4e754
commit
12d76349b6
@ -35,7 +35,10 @@
|
||||
"mcp__code-review-graph__build_or_update_graph_tool",
|
||||
"mcp__code-review-graph__semantic_search_nodes_tool",
|
||||
"mcp__code-review-graph__query_graph_tool",
|
||||
"mcp__code-review-graph__detect_changes_tool"
|
||||
"mcp__code-review-graph__detect_changes_tool",
|
||||
"Bash(cd \"/e/00项目/T_碳信网/code/txw/txw-mhzc-web\" && grep -nE \"closeAll|^\\\\s*close|export\\\\s+\\(function|const\\)\\\\s+close\" node_modules/tdesign-vue/es/message/index.js node_modules/tdesign-vue/es/message/plugin.js 2>/dev/null | head -30)",
|
||||
"Read(//e/e/00项目/T_碳信网/code/txw/txw-mhzc-web/node_modules/tdesign-vue/es/message/**)",
|
||||
"Bash(cd \"/e/00项目/T_碳信网/code/txw/txw-mhzc-web\" && cat node_modules/tdesign-vue/es/message/index.d.ts 2>/dev/null)"
|
||||
]
|
||||
},
|
||||
"enableAllProjectMcpServers": true,
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
||||
# Compiled class file
|
||||
.claude
|
||||
*.class
|
||||
target
|
||||
classes
|
||||
|
||||
@ -1,13 +1,31 @@
|
||||
// 用 Symbol 存"敬请期待"当前实例引用,避免被 Vue 响应式系统代理,也避免污染可枚举属性
|
||||
const COMING_SOON_INSTANCE = Symbol('comingSoonInstance')
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
/**
|
||||
* 显示"敬请期待"提示,做组件级单例:
|
||||
* 屏幕上同一时刻最多只有一个;连点时关掉旧的再开新的,旧的自动消失。
|
||||
* @message 是 TDesign 的 MessagePlugin(main.js 里挂到 Vue.prototype.$message),
|
||||
* info() 返回 Promise<messageInstance>,实例有 close()。
|
||||
*/
|
||||
showComingSoon() {
|
||||
if (this._comingSoonLock) return
|
||||
this._comingSoonLock = true
|
||||
this.$message.info(String.fromCharCode(25964,35831,26399,24453))
|
||||
setTimeout(function() { this._comingSoonLock = false }, 2000)
|
||||
}
|
||||
const prev = this[COMING_SOON_INSTANCE]
|
||||
if (prev) {
|
||||
prev.close()
|
||||
this[COMING_SOON_INSTANCE] = null
|
||||
}
|
||||
this.$message.info('敬请期待').then((instance) => {
|
||||
this[COMING_SOON_INSTANCE] = instance
|
||||
})
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
this._comingSoonLock = false
|
||||
}
|
||||
};
|
||||
// 离页前关掉,避免跳页后残留
|
||||
const instance = this[COMING_SOON_INSTANCE]
|
||||
if (instance) {
|
||||
instance.close()
|
||||
this[COMING_SOON_INSTANCE] = null
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user