调整属性顺序

This commit is contained in:
2021-05-23 23:35:58 +08:00
parent ae94104f47
commit 96cf231cbd
5 changed files with 37 additions and 37 deletions

View File

@@ -42,6 +42,11 @@
<script> <script>
export default { export default {
name: 'About', name: 'About',
beforeRouteEnter(to, from, next) {
next(vm => {
vm.utils.changeTitle('关于');
});
},
data() { data() {
return { return {
navLinks: this.$root.navLinks, navLinks: this.$root.navLinks,
@@ -51,11 +56,6 @@ export default {
} }
} }
}, },
beforeRouteEnter(to, from, next) {
next(vm => {
vm.utils.changeTitle('关于');
});
}
} }
</script> </script>

View File

@@ -120,6 +120,11 @@ export default {
components: { components: {
Icon Icon
}, },
beforeRouteEnter(to, from, next) {
next(vm => {
vm.utils.changeTitle();
});
},
data() { data() {
return { return {
config: this.$root.config.storage, config: this.$root.config.storage,
@@ -165,11 +170,6 @@ export default {
} }
} }
}, },
beforeRouteEnter(to, from, next) {
next(vm => {
vm.utils.changeTitle();
});
},
methods: { methods: {
/** /**

View File

@@ -35,17 +35,17 @@
<script> <script>
export default { export default {
name: 'Settings', name: 'Settings',
beforeRouteEnter(to, from, next) {
next(vm => {
vm.utils.changeTitle('设置');
});
},
data() { data() {
return { return {
config: this.$root.config.storage, config: this.$root.config.storage,
utils: this.$root.utils utils: this.$root.utils
} }
}, },
beforeRouteEnter(to, from, next) {
next(vm => {
vm.utils.changeTitle('设置');
});
},
methods: { methods: {
/** /**

View File

@@ -49,6 +49,20 @@ import navTools from '@/assets/js/navTools.js';
export default { export default {
name: 'Tools', name: 'Tools',
beforeRouteEnter(to, from, next) {
next(vm => {
var route = vm.$route;
// 判断进入的路由
if (route.name == 'ToolsDetail') {
// 进入:工具内容页面
vm.detailOpen(route.params.category, route.params.name);
} else {
// 进入:工具列表页面
vm.utils.changeTitle('小工具');
}
});
},
data() { data() {
return { return {
utils: this.$root.utils, utils: this.$root.utils,
@@ -147,20 +161,6 @@ export default {
} }
}, },
beforeRouteEnter(to, from, next) {
next(vm => {
var route = vm.$route;
// 判断进入的路由
if (route.name == 'ToolsDetail') {
// 进入:工具内容页面
vm.detailOpen(route.params.category, route.params.name);
} else {
// 进入:工具列表页面
vm.utils.changeTitle('小工具');
}
});
}
} }
</script> </script>

View File

@@ -9,13 +9,6 @@ import navTools from '@/assets/js/navTools.js';
export default { export default {
name: 'ToolsDetail', name: 'ToolsDetail',
data() {
return {
utils: this.$root.utils,
toolList: navTools,
toolElem: null
}
},
beforeRouteEnter(to, from, next) { beforeRouteEnter(to, from, next) {
next(vm => { next(vm => {
var params = vm.$route.params; var params = vm.$route.params;
@@ -49,7 +42,14 @@ export default {
return elem; return elem;
}); });
}); });
},
data() {
return {
utils: this.$root.utils,
toolList: navTools,
toolElem: null
} }
},
} }
</script> </script>