|
|
@@ -15,20 +15,11 @@
|
|
|
</div>
|
|
|
<!-- tab栏 -->
|
|
|
<div class="tab">
|
|
|
- <div
|
|
|
- class="tab_row"
|
|
|
- v-for="item in tabArr"
|
|
|
- :key="item.id"
|
|
|
- @click="jump(item.url)"
|
|
|
- >
|
|
|
+ <div class="tab_row" v-for="item in tabArr" :key="item.id" @click="jump(item.url)">
|
|
|
<div :class="{ active: $route.meta.myInd === item.id }">
|
|
|
{{ item.name }}
|
|
|
</div>
|
|
|
- <img
|
|
|
- v-show="$route.meta.myInd === item.id"
|
|
|
- src="@/assets/img/active.png"
|
|
|
- alt=""
|
|
|
- />
|
|
|
+ <img v-show="$route.meta.myInd === item.id" src="@/assets/img/active.png" alt="" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -53,7 +44,7 @@ export default {
|
|
|
{ url: "tab3", id: 3, name: "文物典藏" },
|
|
|
{ url: "tab4", id: 4, name: "信息检索" }
|
|
|
],
|
|
|
- };
|
|
|
+ }
|
|
|
},
|
|
|
// 监听属性 类似于data概念
|
|
|
computed: {},
|
|
|
@@ -63,29 +54,30 @@ export default {
|
|
|
methods: {
|
|
|
// 点击tab栏
|
|
|
jump(url) {
|
|
|
- if (url === "tab1") url = "/index?m=TEST";
|
|
|
- this.$router.replace(url).catch(() => {});
|
|
|
- if (url === "/index?m=TEST") {
|
|
|
- this.$nextTick(() => {
|
|
|
- setTimeout(() => {
|
|
|
- location.reload(true);
|
|
|
- }, 300);
|
|
|
- });
|
|
|
- }
|
|
|
+ this.$router.replace(url).catch(() => { })
|
|
|
+ // if (url === "tab1") url = "/index?m=TEST";
|
|
|
+ // this.$router.replace(url).catch(() => {});
|
|
|
+ // if (url === "/index?m=TEST") {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // location.reload(true);
|
|
|
+ // }, 300);
|
|
|
+ // });
|
|
|
+ // }
|
|
|
},
|
|
|
},
|
|
|
// 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {},
|
|
|
+ created() { },
|
|
|
// 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
- mounted() {},
|
|
|
- beforeCreate() {}, // 生命周期 - 创建之前
|
|
|
- beforeMount() {}, // 生命周期 - 挂载之前
|
|
|
- beforeUpdate() {}, // 生命周期 - 更新之前
|
|
|
- updated() {}, // 生命周期 - 更新之后
|
|
|
- beforeDestroy() {}, // 生命周期 - 销毁之前
|
|
|
- destroyed() {}, // 生命周期 - 销毁完成
|
|
|
- activated() {}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
-};
|
|
|
+ mounted() { },
|
|
|
+ beforeCreate() { }, // 生命周期 - 创建之前
|
|
|
+ beforeMount() { }, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate() { }, // 生命周期 - 更新之前
|
|
|
+ updated() { }, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy() { }, // 生命周期 - 销毁之前
|
|
|
+ destroyed() { }, // 生命周期 - 销毁完成
|
|
|
+ activated() { }, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+}
|
|
|
</script>
|
|
|
<style lang='less' scoped>
|
|
|
.layout {
|
|
|
@@ -154,7 +146,7 @@ export default {
|
|
|
width: 53px;
|
|
|
height: 19px;
|
|
|
}
|
|
|
- &:hover div{
|
|
|
+ &:hover div {
|
|
|
color: #f2cd83;
|
|
|
}
|
|
|
}
|