|
@@ -85,11 +85,54 @@ export default {
|
|
//监控data中的数据变化
|
|
//监控data中的数据变化
|
|
watch: {
|
|
watch: {
|
|
// 监听地址栏参数变化
|
|
// 监听地址栏参数变化
|
|
- $route() {
|
|
|
|
- // 拿到路由参数id
|
|
|
|
- let temp = this.$route.params.id;
|
|
|
|
- this.mbTxt = temp;
|
|
|
|
- this.data = Collections[this.mbTxt];
|
|
|
|
|
|
+ $route: {
|
|
|
|
+ handler() {
|
|
|
|
+ // 拿到路由参数id
|
|
|
|
+ let temp = this.$route.params.id;
|
|
|
|
+ this.mbTxt = temp;
|
|
|
|
+ this.data = Collections[this.mbTxt];
|
|
|
|
+
|
|
|
|
+ let keyword = ''
|
|
|
|
+ switch (this.mbTxt) {
|
|
|
|
+ case 'Bronzes':
|
|
|
|
+ keyword = 'Bronzes'
|
|
|
|
+ break;
|
|
|
|
+ case 'Ceramics':
|
|
|
|
+ keyword = 'Ceramics'
|
|
|
|
+ break;
|
|
|
|
+ case 'Buddhist':
|
|
|
|
+ keyword = 'buddhist statues'
|
|
|
|
+ break;
|
|
|
|
+ case 'Jadewares':
|
|
|
|
+ keyword = 'Jadewares'
|
|
|
|
+ break;
|
|
|
|
+ case 'Calligraphies':
|
|
|
|
+ keyword = 'Calligraphies'
|
|
|
|
+ break;
|
|
|
|
+ case 'Paintings':
|
|
|
|
+ keyword = 'Paintings'
|
|
|
|
+ break;
|
|
|
|
+ case 'Gold':
|
|
|
|
+ keyword = 'gold & silverwares'
|
|
|
|
+ break;
|
|
|
|
+ case 'Coins':
|
|
|
|
+ keyword = 'coins & banknotes'
|
|
|
|
+ break;
|
|
|
|
+ case 'Brocades':
|
|
|
|
+ keyword = 'brocades & embroideries'
|
|
|
|
+ break;
|
|
|
|
+ case 'Cultural':
|
|
|
|
+ keyword = 'cultural supplies'
|
|
|
|
+ break;
|
|
|
|
+ case 'Miscellaneous':
|
|
|
|
+ keyword = 'miscellaneous arts'
|
|
|
|
+ break;
|
|
|
|
+ default:
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ this.$eventBus.$emit('request-read', `You've reached the page contains tiles of ${keyword} of the Collections section. This page contains one navigation section, six window sections, and one interactive section. To choose a section, please hit the shortcut key.`)
|
|
|
|
+ },
|
|
|
|
+ immediate: true,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
//方法集合
|
|
//方法集合
|
|
@@ -110,10 +153,6 @@ export default {
|
|
},
|
|
},
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
created() {
|
|
created() {
|
|
- // 拿到路由参数id
|
|
|
|
- let temp = this.$route.params.id;
|
|
|
|
- this.mbTxt = temp;
|
|
|
|
- this.data = Collections[this.mbTxt];
|
|
|
|
},
|
|
},
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
mounted() {},
|
|
mounted() {},
|