Browse Source

bug fixed

duwendi 2 years ago
parent
commit
7aa39ea8bc
1 changed files with 12 additions and 7 deletions
  1. 12 7
      src/pages/homepage/components/cardWrap.vue

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

@@ -2,7 +2,7 @@
2
   <div class="body-wrapper">
2
   <div class="body-wrapper">
3
     <div class="search-wrapper">
3
     <div class="search-wrapper">
4
       <div class="header-row">
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
           <p>{{ item.title }}</p>
6
           <p>{{ item.title }}</p>
7
           <div class="flex" style="padding-top: 10px;">
7
           <div class="flex" style="padding-top: 10px;">
8
             <div style="width: 26%;" class="middle-flex">
8
             <div style="width: 26%;" class="middle-flex">
@@ -17,7 +17,7 @@
17
       </div>
17
       </div>
18
       <div style="height: 72px; text-align: center; background: #fff; padding-top: 10px;">
18
       <div style="height: 72px; text-align: center; background: #fff; padding-top: 10px;">
19
         <el-input class="input-wrapper" v-model="searchWords" placeholder="请输入关键字">
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
 <!--            <i class="el-icon-search"></i>-->
21
 <!--            <i class="el-icon-search"></i>-->
22
             <img src="../../../../static/homepage/u432.svg" alt="">
22
             <img src="../../../../static/homepage/u432.svg" alt="">
23
           </el-button>
23
           </el-button>
@@ -50,6 +50,7 @@
50
 export default {
50
 export default {
51
     data() {
51
     data() {
52
         return {
52
         return {
53
+          searchWords: '',
53
           menus: [{
54
           menus: [{
54
             title: '主题库资源',
55
             title: '主题库资源',
55
             new: 312,
56
             new: 312,
@@ -75,11 +76,15 @@ export default {
75
 
76
 
76
     },
77
     },
77
     methods: {
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
 </script>
90
 </script>