康凯
2021-12-12 96c705e7c0eb114695c04a0500a4abc815739cf6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<template>
  <div class="search">
    <div class="search-input">
      <custom-search2 v-on:search="Search" v-on:focus="Focus"></custom-search2>
    </div>
    <div class="search-content">
      <transition name="fade-transform" mode="out-in">
        <router-view :key="key"/>
      </transition>
    </div>
  </div>
</template>
 
<script>
import CustomSearch2 from "@/components/CustomSearch2";
 
export default {
  name: "searchIndex",
  components: {CustomSearch2},
  methods: {
    Search: function (searchType, searchName) {
      this.$router.push({
        name: 'search-results',
        query: {
          searchType: searchType,
          searchName: searchName
        }
      });
 
    },
    Focus: function () {
      this.$router.push({
        name: 'search-index'
      });
    }
  },
  computed: {
    key() {
      return this.$route.path
    }
  }
}
</script>
 
<style scoped>
.search {
  width: 100%;
}
 
.search .search-input {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
 
  width: 100%;
  height: 10vh;
  background: url("../../assets/search/search@1x.png") no-repeat 100% 100%;
  background-size: cover;
}
 
.search .search-input .custom-search2 {
  width: 90%;
}
 
.search .search-content {
  width: 100%;
  background: #FFFFFF;
  border-radius: 10px 10px 0px 0px;
 
  position: relative;
  top: -10px;
  z-index: 10;
}
</style>