Parcourir la source

修复一下

1
mo il y a 3 ans
Parent
commit
33dfa53c63
4 fichiers modifiés avec 8 ajouts et 3 suppressions
  1. 1 1
      package.json
  2. 1 0
      src/helpers/index.js
  3. 5 2
      src/layout/components/TagsView.vue
  4. 1 0
      vue.config.js

+ 1 - 1
package.json

@@ -5,7 +5,7 @@
   "author": "Pan <panfree23@gmail.com>",
   "license": "MIT",
   "scripts": {
-    "dev": "vue-cli-service serve",
+    "dev": "vue-cli-service serve --hot",
     "build": "vue-cli-service build",
     "preview": "npx http-server ./dist -P http://dev.dayaedu.com",
     "lint": "eslint --ext .js,.vue src",

+ 1 - 0
src/helpers/index.js

@@ -65,6 +65,7 @@ export class Searchs {
     if (!this.searchs[k]) {
       this.searchs[k] = {...initSearch}
     }
+
     if (type) {
       this.searchs[k][type] = data
     } else {

+ 5 - 2
src/layout/components/TagsView.vue

@@ -71,12 +71,13 @@ export default {
         for (const key in s.searchs) {
           if (Object.hasOwnProperty.call(s.searchs, key)) {
             const item = s.searchs[key];
-            if (item.bind === this.$route.path) {
+            if (item.bind === this.$route.path&&item.bind!=='/main/main') {
               keys.push(key);
             }
           }
         }
         for (const item of keys) {
+
           s.removeByKey(item);
         }
       }
@@ -111,6 +112,7 @@ export default {
       return route.path === this.$route.path;
     },
     syncTagViewAndSaveForm() {
+
       const keys = this.$store.state.tagsView.visitedViews.map((item) => {
         //  (item)
         return item.path;
@@ -122,6 +124,7 @@ export default {
       let route = this.$route;
       for (const item of sks) {
         if (!(keys.includes(item) || keys.includes(allSearch[item].bind))) {
+
           searchs.removeByKey(item);
         }
 
@@ -172,7 +175,6 @@ export default {
           if (this.isActive(view)) {
 
             const latestView = views[views.length -2];
-            console.log(views)
             if (latestView) {
               this.$router.push(latestView.fullPath);
             } else {
@@ -184,6 +186,7 @@ export default {
           console.log(e)
         }
       } else {
+
         const searchs = new Searchs();
         searchs.remove(this.$route.path);
         this.$store

+ 1 - 0
vue.config.js

@@ -49,6 +49,7 @@ module.exports = {
   devServer: {
     // port: 443,
     open: false,
+    hot:true,
     disableHostCheck: true,
     // overlay: {
     //   warnings: false,