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
76
77
78
79
80
| <template>
| <a-row type="flex" justify="start" >
| <a-col v-bind="showSmall">
| <router-link to="/main1">Home »</router-link>
| </a-col>
| <a-col v-bind="showSmall">
| <router-link to="/main2">乐谱搜索 »</router-link>
| </a-col>
| <a-col v-bind="showSmall">
| <router-link to="/main3">动漫搜索 »</router-link>
| </a-col>
| <a-col v-bind="showMain">
| <router-link to="/tagInfo">关于我 »</router-link>
| </a-col>
| <a-col v-bind="showMain">
| <a-auto-complete v-bind="search" @select="onSelect" @search="onSearch" @change="onChange">
| <a-input>
| <a-icon slot="suffix" type="search" class="certain-category-icon" />
| </a-input>
| </a-auto-complete>
| </a-col>
|
| </a-row>
|
| </template>
|
| <script>
| export default {
|
| data() {
| return {
| search: {
| placeholder: "全局搜索..",
| allowClear: true,
| // autoFocus: true,
| backfill: true,
| dataSource: [],
| },
| showSmall: {
| xs: 6,
| sm: 6,
| md: 6,
| lg: 6,
| xl: 6,
| xxl: 6,
| },
| showMain: {
| xs: 0,
| sm: 0,
| md: 2,
| lg: 2,
| xl: 2,
| xxl: 2,
| }
| }
|
| },
| watch: {
| value(val) {
| console.log('值:', val);
| },
| },
| methods: {
| onSearch(searchText) {
| this.dataSource = !searchText ? [] : [searchText, searchText.repeat(2), searchText.repeat(3)];
| console.log("补全..");
| },
| onSelect(value) {
| console.log('回车', value);
| },
| onChange(value) {
| console.log('修改', value);
| },
| keyListener(value) {
| console.log('ref', this.$refs.mySearch);
| console.log('键盘', value);
| },
| },
| }
| </script>
|
|