duwendi 1 年間 前
コミット
7aa39ea8bc
共有1 個のファイルを変更した12 個の追加7 個の削除を含む
  1. 12 7
      src/pages/homepage/components/cardWrap.vue

+ 12 - 7
src/pages/homepage/components/cardWrap.vue

@@ -2,7 +2,7 @@
2 2
   <div class="body-wrapper">
3 3
     <div class="search-wrapper">
4 4
       <div class="header-row">
5
-        <div v-for="(item, index) in menus" :key="index"  class="menu-btn" style="width: 16%" @click="handleToPage(item, item.url)">
5
+        <div v-for="(item, index) in menus" :key="index"  class="menu-btn" style="width: 16%" @click="jumpToSearchPage(item)">
6 6
           <p>{{ item.title }}</p>
7 7
           <div class="flex" style="padding-top: 10px;">
8 8
             <div style="width: 26%;" class="middle-flex">
@@ -17,7 +17,7 @@
17 17
       </div>
18 18
       <div style="height: 72px; text-align: center; background: #fff; padding-top: 10px;">
19 19
         <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
20
-          <el-button slot="append" class="searchbtn" @click="searchInput">
20
+          <el-button slot="append" class="searchbtn" @click="jumpToSearchPage">
21 21
 <!--            <i class="el-icon-search"></i>-->
22 22
             <img src="../../../../static/homepage/u432.svg" alt="">
23 23
           </el-button>
@@ -50,6 +50,7 @@
50 50
 export default {
51 51
     data() {
52 52
         return {
53
+          searchWords: '',
53 54
           menus: [{
54 55
             title: '主题库资源',
55 56
             new: 312,
@@ -75,11 +76,15 @@ export default {
75 76
 
76 77
     },
77 78
     methods: {
78
-      handleToPage(val, url) {
79
-        if (url) {
80
-          this.$router.push({ path: url });
81
-        }
82
-      }
79
+      jumpToSearchPage(item) {
80
+        this.$router.push({
81
+          name: "searchPage",
82
+          path: "/searchPage",
83
+          query: {
84
+            searchword: this.searchWords
85
+          }
86
+        });
87
+      },
83 88
     }
84 89
 }
85 90
 </script>