inleft
2022-07-14 e45377e8f94faf25a98b9e5a645055b5fade4818
commit | author | age
56a4b8 1 <template>
I 2     <div class="blog-cell ">
3         <div class="blog-container">
4             <div class="blog-user-message blog-cell ">
5                 <span>{{searchType}}</span>
6                 <hr>
7                 <div>
8                     <a-auto-complete v-bind="search" @select="onSelect" @search="onSearch" @change="onChange">
fc0c10 9                         <a-input @pressEnter="onSelect">
56a4b8 10                             <a-icon slot="suffix" type="search" class="certain-category-icon" />
I 11                         </a-input>
12                     </a-auto-complete>
13                 </div>
14                 <hr>
15                 <span>{{sentence}}</span>
56fe69 16                 <!-- <span>之所以叫月台,是希望,能在这里出现的视频会越来越多,熙熙囔囔</span> -->
56a4b8 17             </div>
I 18         </div>
19     </div>
20
21 </template>
22
23 <script>
24     export default {
25         name: "box",
26         props: {
27             searchType: ""
28         },
29         data() {
30             return {
31                 sentence: "十里寒塘路,烟花一半醒",
32                 search: {
33                     placeholder: "搜索..",
34                     // autoFocus: true,
35                     backfill: true,
fc0c10 36                     value: '',
56a4b8 37                     dataSource: [],
I 38                 },
39             }
40         },
41         methods: {
42             onSearch(searchText) {
43                 this.dataSource = !searchText ? [] : [searchText, searchText.repeat(2), searchText.repeat(3)];
44                 console.log("补全..");
45             },
46             onSelect(value) {
fc0c10 47                 this.$message.info("更多功能..敬请期待")
56a4b8 48                 console.log('回车', value);
I 49             },
50             onChange(value) {
51                 console.log('修改', value);
52             },
53             keyListener(value) {
54                 console.log('ref', this.$refs.mySearch);
55                 console.log('键盘', value);
56             },
57         },
58     }
59 </script>
60
61 </script>
62
63 <style lang="less">
64
65 </style>