|
@@ -1,43 +1,54 @@
|
|
|
<template>
|
|
|
<div id="app" class="container-fluid">
|
|
|
- <router-view v-if="isRouterAlive"/>
|
|
|
+ <router-view v-if="isRouterAlive" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import NavMenu from './nav-menu'
|
|
|
+import NavMenu from './nav-menu'
|
|
|
|
|
|
- export default {
|
|
|
- components: {
|
|
|
- 'nav-menu': NavMenu,
|
|
|
- },
|
|
|
- provide () { //父组件中通过provide来提供变量,在子组件中通过inject来注入变量。
|
|
|
- return {
|
|
|
- reload: this.reload
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- reload() {
|
|
|
- this.isRouterAlive = false
|
|
|
- this.$nextTick(function () {
|
|
|
- this.isRouterAlive = true
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- isRouterAlive:true
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ 'nav-menu': NavMenu,
|
|
|
+ },
|
|
|
+ provide() { //父组件中通过provide来提供变量,在子组件中通过inject来注入变量。
|
|
|
+ return {
|
|
|
+ reload: this.reload
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ reload() {
|
|
|
+ this.isRouterAlive = false
|
|
|
+ this.$nextTick(function () {
|
|
|
+ this.isRouterAlive = true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ isRouterAlive: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ '$i18n.locale': {
|
|
|
+ handler(n, o) {
|
|
|
+ document.title = this.$t('system.title')
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
- #app, body, html {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI','Microsoft YaHei','微软雅黑', 'Microsoft JhengHei';
|
|
|
- }
|
|
|
+#app,
|
|
|
+body,
|
|
|
+html {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI",
|
|
|
+ "Microsoft YaHei", "微软雅黑", "Microsoft JhengHei";
|
|
|
+}
|
|
|
</style>
|