添加版本号、添加加载动画

This commit is contained in:
2021-05-05 19:22:08 +08:00
parent d8221b94e7
commit 47547764cd
2 changed files with 23 additions and 4 deletions

View File

@@ -115,8 +115,9 @@ export default {
// 更新页面标题
this.utils.changeTitle(info.title);
// 更新 drawer 标题
this.detail.title = info.title;
this.detail.title = `${info.title} [${info.version}_${info.update}]`;
// 路由跳转
// 注:当前路由相同时也进行跳转,以更新 query
this.$router.push({
name: 'ToolsDetail',
params: {

View File

@@ -10,7 +10,6 @@ export default {
data() {
return {
utils: this.$root.utils,
routeQuery: {},
toolElem: null
}
},
@@ -18,16 +17,35 @@ export default {
next(vm => {
var params = vm.$route.params;
var query = vm.$route.query;
var loading = null;
console.log('[打开工具] params', params);
console.log('[打开工具] query', query);
vm.toolElem = () => {
// 异步,防止找不到 target
setTimeout(() => {
// 开启 Loading
loading = vm.$loading({
background: '#FFF',
lock: true,
// Loading 需要覆盖的 DOM 节点
target: '.drawer-full .el-drawer__body'
});
}, 0);
vm.toolElem = (() => {
// 动态引入组件
var elem = import(`@/components/tools/${query.component}.vue`);
Promise.all([elem]).then(() => {
setTimeout(() => {
// 关闭 Loading
loading.close();
}, 200);
});
return elem;
};
});
});
}
}