Przeglądaj źródła

尝试修复document.title部分机型失效问题

shaogen1995 3 lat temu
rodzic
commit
c704f40bb6

+ 1 - 1
webM/src/router/index.js

@@ -311,7 +311,7 @@ router.beforeEach((to, from, next) => {
 // 全局后置钩子,设置title
 router.afterEach(to => {
   // 设置title
-  document.title = to.meta.myTitle;
+  window.document.title = to.meta.myTitle;
 })
 
 

+ 1 - 1
webM/src/views/Collections/Detail.vue

@@ -38,7 +38,7 @@ export default {
       if (v.id === id) this.data = v;
     });
     setTimeout(() => {
-      document.title = this.data.h3;
+      window.document.title = this.data.h3;
     }, 100);
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 1 - 1
webM/src/views/Collections/info.vue

@@ -64,7 +64,7 @@ export default {
         if (k === temp) temp = this.mate[k];
       }
       setTimeout(() => {
-        document.title = temp;
+        window.document.title = temp;
       }, 100);
       this.txt = temp;
     },

+ 1 - 1
webM/src/views/Exhibitions/Detail.vue

@@ -214,7 +214,7 @@ export default {
     this.$nextTick(() => {
       setTimeout(() => {
         // 改变网址title
-        document.title = this.data.title;
+        window.document.title = this.data.title;
 
         let tempArr = this.data.page;
         let dom = document.querySelector(".card");

+ 1 - 1
webM/src/views/Exhibitions/Galleries.vue

@@ -73,7 +73,7 @@ export default {
       if (v.id === id) this.data = v.info;
     });
     setTimeout(() => {
-      document.title = "Exhibition Galleries";
+      window.document.title = "Exhibition Galleries";
     }, 100);
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 1 - 1
webM/src/views/Exhibitions/Objects.vue

@@ -73,7 +73,7 @@ export default {
       if (v.id === id) this.data = v.info;
     });
     setTimeout(() => {
-      document.title = 'Exhibition Objects';
+      window.document.title = 'Exhibition Objects';
     }, 100);
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 1 - 1
webM/src/views/Join/info.vue

@@ -46,7 +46,7 @@ export default {
       if (v.id === id) this.data = v;
     });
     setTimeout(() => {
-      document.title = this.data.h3;
+      window.document.title = this.data.h3;
     }, 100);
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 1 - 1
webM/src/views/Learn/info.vue

@@ -52,7 +52,7 @@ export default {
       if (v.id === id) this.data = v.info;
     });
     setTimeout(() => {
-      document.title = this.data.title;
+      window.document.title = this.data.title;
     }, 100);
   },
   beforeCreate() {}, //生命周期 - 创建之前

+ 1 - 1
webM/src/views/Publications/info.vue

@@ -36,7 +36,7 @@ export default {
     }
     setTimeout(() => {
       // 设置title
-      document.title = this.info.p;
+      window.document.title = this.info.p;
     }, 100);
   },
   //生命周期 - 挂载完成(可以访问DOM元素)

+ 1 - 1
webM/src/views/Publications/lookPdf.vue

@@ -67,7 +67,7 @@ export default {
       setTimeout(() => {
         let dom = document.querySelector(".Layout .bottom");
         dom.style.display = "none";
-        document.title = this.info.name;
+        window.document.title = this.info.name;
         // 获取顶部固定栏
         let LayoutTop = document.querySelector(".Layout .top");
         LayoutTop.style.display = "none";