result.vue
1 KB
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
<template>
<div class="home-search">
<SearchLayout :history="false" :defKeyword="keyword" :searchData="data" @search="handleSearch" />
</div>
</template>
<script>
import SearchLayout from './components/SearchLayout'
export default {
name: 'HomeSearchResult',
components: { SearchLayout },
data () {
return {
keyword: null,
data: null
}
},
methods: {
handleSearch (val) {
this.data = {
apps: [{ icon: '', name: '新闻动态' }],
modules: [
{
type: 1 + parseInt(Math.random() * 3),
list: [
{
title: '创新推出碳中和债,助理实现30·60目标',
date: '2020-02-02',
dataType: '公告'
}
]
}
]
}
}
},
mounted () {
const { keyword } = this.$route.query
this.keyword = keyword
this.handleSearch(keyword)
}
}
</script>
<style lang="less" scoped>
.home-search {
height: 100%;
}
</style>