lijh
2022-01-13 ad2b70777b866a9f4848a89fd0e343f991f8a604
commit | author | age
ad2b70 1 <template>
L 2     <div>
3         <a-row type="flex" justify="start">
4             <a-col v-bind="showSmall">
5                 <router-link class="btn" to="/main1">Home »</router-link>
6             </a-col>
7             <a-col v-bind="showSmall">
8                 <router-link class="btn" to="/main1">Home2 »</router-link>
9             </a-col>
10             <a-col v-bind="showSmall">
11                 <router-link class="btn" to="/main2">我的信息 »</router-link>
12             </a-col>
13             <a-col v-bind="showMain">
14                 <a-auto-complete v-bind="search" @select="onSelect" @search="onSearch" @change="onChange">
15                     <a-input>
16                         <a-icon slot="suffix" type="search" class="certain-category-icon" />
17                     </a-input>
18                 </a-auto-complete>
19             </a-col>
20             <a-col v-bind="showMain">
21                 <router-link class="btn" to="/main2">我的信息 »</router-link>
22             </a-col>
23         </a-row>
24     </div>
25
26 </template>
27
28 <script>
29     export default {
30
31         data() {
32             return {
33                 search: {
34                     placeholder: "全局搜索..",
35                     allowClear: true,
36                     // autoFocus: true,
37                     backfill: true,
38                     dataSource: [],
39                 },
40                 showSmall: {
41                     xs: 6,
42                     sm: 6,
43                     md: 6,
44                     lg: 6,
45                     xl: 6,
46                     xxl: 6,
47                 },
48                 showMain: {
49                     xs: 0,
50                     sm: 0,
51                     md: 2,
52                     lg: 2,
53                     xl: 2,
54                     xxl: 2,
55                 }
56             }
57
58         },
59         watch: {
60             value(val) {
61                 console.log('值:', val);
62             },
63         },
64         methods: {
65             onSearch(searchText) {
66                 this.dataSource = !searchText ? [] : [searchText, searchText.repeat(2), searchText.repeat(3)];
67                 console.log("补全..");
68             },
69             onSelect(value) {
70                 console.log('回车', value);
71             },
72             onChange(value) {
73                 console.log('修改', value);
74             },
75             keyListener(value) {
76                 console.log('ref', this.$refs.mySearch);
77                 console.log('键盘', value);
78             },
79         },
80     }
81 </script>
82
83 </script>
84
85 <style lang="less">
86     /*头像部分*/
87     .blog-avatar {
88         border-radius: 15px;
89         background-color: white;
90
91         img {
92             width: 60px;
93             height: auto;
94             border-radius: 50%;
95             display: block;
96             margin: 10px auto 10px;
97             padding-top: 10px;
98         }
99     }
100
101     /* 一言 */
102     .blog-user-message {
103         text-align: center;
104         font-size: 15px;
105         color: #555;
106         padding-top: 10px;
107         padding-bottom: 10px;
108
109         span {
110             display: block;
111             padding-bottom: 5px;
112         }
113     }
114 </style>