Kaynağa Gözat

修改搜索跳转逻辑

bruce 5 yıl önce
ebeveyn
işleme
e73739c069
1 değiştirilmiş dosya ile 7 ekleme ve 3 silme
  1. 7 3
      components/header.vue

+ 7 - 3
components/header.vue

@@ -379,9 +379,13 @@
         location.href = this.baseUrl + url;
       },
       clickInputEnter() {
-        console.log("location ==", this.$route.path + "/?keyword=" + this.keywork);
-        console.log("window.location ==", window.location.href);
-        window.location.href = this.$route.path + "/?keyword=" + this.keywork;
+        // console.log("location ==", this.$route.path + "/?keyword=" + this.keywork);
+        // console.log("window.location ==", window.location.href);
+        // console.log("windown.location.hostname=", window.location.hostname);
+        // console.log("windown.location.pathname=", window.location.pathname);
+        let url = window.location.hostname + "/" + window.location.pathname + "/?keyword=" + this.keywork;
+        console.log(url);
+        window.location.href = url;
       },
       async getMessageCount() {
         let res = await this.$axios.$get(