|
@@ -9,35 +9,58 @@
|
|
|
import menuList from '@/components/menuList.vue'
|
|
|
|
|
|
export default {
|
|
|
- props: [],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- modelNum: 0,
|
|
|
- // shebeisheshiShow: false,
|
|
|
- routerName: 'aa',
|
|
|
- imgSrcNum: 1,
|
|
|
- tanchuanShow: false
|
|
|
- }
|
|
|
+ props: [],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ modelNum: 0,
|
|
|
+ // shebeisheshiShow: false,
|
|
|
+ routerName: "aa",
|
|
|
+ imgSrcNum: 1,
|
|
|
+ tanchuanShow: false,
|
|
|
+ showMenu: true, //是否显隐menuList
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ created() { },
|
|
|
+ mounted() {
|
|
|
+ // 路由为home下的legendLibrary(图例)时,刷新时执行 handleRoute 路由处理函数
|
|
|
+ this.handleRoute(this.$route);
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ // tanchuanShow(newVal) {
|
|
|
+ // console.log(newVal)
|
|
|
+ // }
|
|
|
+ $route: "handleRoute",
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handlerouterName(val) {
|
|
|
+ console.log(val);
|
|
|
+ this.routerName = val;
|
|
|
+ if (val == "de") {
|
|
|
+ this.modelNum = 3;
|
|
|
+ } else if (val == "floorFunc") {
|
|
|
+ this.modelNum = 2;
|
|
|
+ }
|
|
|
},
|
|
|
- computed: {},
|
|
|
- created() {},
|
|
|
- mounted() {},
|
|
|
- watch: {
|
|
|
- // tanchuanShow(newVal) {
|
|
|
- // console.log(newVal)
|
|
|
- // }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- handlerouterName(val) {
|
|
|
- console.log(val)
|
|
|
- this.routerName = val
|
|
|
- if (val == 'de') {
|
|
|
- this.modelNum = 3
|
|
|
- } else if (val == 'floorFunc') {
|
|
|
- this.modelNum = 2
|
|
|
- }
|
|
|
- }
|
|
|
+ /**
|
|
|
+ * @name handleRoute
|
|
|
+ * @param newRoute 当前路由
|
|
|
+ * @description 路由处理函数, 当前路由为home下的legendLibrary(图例)时,隐藏 menuList组件
|
|
|
+ */
|
|
|
+ handleRoute(newRoute) {
|
|
|
+ let path = "";
|
|
|
+ newRoute.path && (path = newRoute.path);
|
|
|
+ if (!path) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ let lastPath = path.split("home/")[1];
|
|
|
+ if (lastPath === "legendLibrary") {
|
|
|
+ this.showMenu = false;
|
|
|
+ } else {
|
|
|
+ this.showMenu = true;
|
|
|
+ }
|
|
|
},
|
|
|
+ },
|
|
|
components: {
|
|
|
menuList
|
|
|
}
|