You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tanghe-report/report-ui/src/App.vue

49 lines
866 B
Vue

3 years ago
<template>
<div id="app">
<router-view v-if="isRouterAlive" />
3 years ago
</div>
</template>
<script>
import "@/assets/iconfont/iconfont.css";
import { initDictToLocalstorage } from "@/api/dict-data";
export default {
name: "App",
provide() {
return {
reload: this.reload
};
},
data() {
return {
isRouterAlive: false
};
},
watch: {
$route(to, form) {
if (to.path == "/login") {
this.queryDictName();
}
}
},
computed: {},
created() {
this.queryDictName();
},
methods: {
queryDictName() {
// 初始化数据字典到浏览器本地缓存
initDictToLocalstorage(() => {
this.isRouterAlive = true;
});
},
reload() {
this.isRouterAlive = false;
this.$nextTick(function() {
this.isRouterAlive = true;
});
}
3 years ago
}
};
3 years ago
</script>