Procházet zdrojové kódy

预览新标签页title名字更改

yxc před 2 roky
rodič
revize
866905f663

+ 7 - 7
src/main.js

@@ -126,10 +126,10 @@ Vue.use(vSelectPage, {
   }
 })
 
-router.beforeEach((to, from, next) => {
-  /* 路由发生变化修改页面title */
-  if (to.meta.title) {
-    document.title = to.meta.title
-  }
-  next()
-})
+// router.beforeEach((to, from, next) => {
+//   /* 路由发生变化修改页面title */
+//   if (to.meta.title) {
+//     document.title = to.meta.title
+//   }
+//   next()
+// })

+ 2 - 0
src/views1/File/Individual/IndividualView.vue

@@ -742,6 +742,8 @@ export default {
       else{
         this.$tab.openPage(
         window.open("/individual/Pre/user/" + row.docId, '_blank'),
+        // window.open("/individual/Pre/user/" + row.docId +"/title/"+ row.docName, '_blank'),
+        localStorage.setItem("docName",row.docName)
       );
       // console.log(111);
       }

+ 2 - 1
src/views1/File/Individual/Pre/PreView.vue

@@ -35,7 +35,8 @@
     },
     created() {
       this.getFile();
-      // document.title=111
+      const docNewname= localStorage.getItem("docName")
+      document.title=docNewname+"预览"
     },
     methods: {
       getFile() {

+ 2 - 2
src/views1/HomeView.vue

@@ -167,7 +167,7 @@ export default {
   },
   methods: {
     handleSelect(key,keyPath) {
-      console.log(keyPath);
+      // console.log(keyPath);
       this.getSrcIndex(keyPath)      
       //点击之后存到本地存储,便于刷新之后调用
       localStorage.setItem('currentSrcIndex', this.srcIndex)
@@ -181,7 +181,7 @@ export default {
           this.srcIndex = '1'
         }
       } else {
-        const currentSrcIndex = keyPathArr[0].split(',')[0] 
+        const currentSrcIndex = keyPathArr[0]
         this.srcIndex = currentSrcIndex
       }
     },