|
@@ -76,10 +76,29 @@ export default {
|
|
|
//监控data中的数据变化
|
|
|
watch: {
|
|
|
// 监听地址栏参数变化
|
|
|
- $route() {
|
|
|
- // 拿到路由参数id
|
|
|
- let temp = this.$route.params.id;
|
|
|
- this.topId = Number(temp);
|
|
|
+ $route: {
|
|
|
+ handler: function() {
|
|
|
+ // 拿到路由参数id
|
|
|
+ let temp = this.$route.params.id;
|
|
|
+ this.topId = Number(temp);
|
|
|
+ switch (temp) {
|
|
|
+ case '1':
|
|
|
+ this.$eventBus.$emit('request-read', `You have reached the Current Exhibitions page of the Exhibitions section. This page includes one navigation section, six window sections, and two interactive section. To choose an section, please hit the shortcut key.`)
|
|
|
+ break;
|
|
|
+ case '2':
|
|
|
+ this.$eventBus.$emit('request-read', `You have reached the Permanent Exhibitions page of the Exhibitions section. This page includes one navigation section, six window sections, and two interactive section. To choose an section, please hit the shortcut key.`)
|
|
|
+ break;
|
|
|
+ case '3':
|
|
|
+ this.$eventBus.$emit('request-read', `You have reached the Past Exhibitions page of the Exhibitions section. This page includes one navigation section, six window sections, and two interactive section. To choose an section, please hit the shortcut key.`)
|
|
|
+ break;
|
|
|
+ case '4':
|
|
|
+ this.$eventBus.$emit('request-read', `You have reached the Overseas Exhibitions page of the Exhibitions section. This page includes one navigation section, six window sections, and two interactive section. To choose an section, please hit the shortcut key.`)
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
},
|
|
|
},
|
|
|
//方法集合
|
|
@@ -90,9 +109,6 @@ export default {
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
- // 拿到路由参数id
|
|
|
- let temp = this.$route.params.id;
|
|
|
- this.topId = Number(temp);
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {},
|