inleft
2024-05-18 57e3bead08715d72efaeffe90fafa179b8366473
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>
16             </div>
17         </div>
18     </div>
19
20 </template>
21
22 <script>
23     export default {
24         name: "box",
25         props: {
6461f5 26             searchType: "",
56a4b8 27         },
I 28         data() {
29             return {
30                 sentence: "十里寒塘路,烟花一半醒",
31                 search: {
6461f5 32                     //placeholder: "搜索..",
I 33                     placeholder: "此搜索框未营业..",
56a4b8 34                     // autoFocus: true,
I 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) {
054cde 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>