inleft
2024-05-18 57e3bead08715d72efaeffe90fafa179b8366473
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
<template>
    <div class="blog-cell ">
        <div class="blog-container">
            <div class="blog-user-message blog-cell ">
                <span>{{searchType}}</span>
                <hr>
                <div>
                    <a-auto-complete v-bind="search" @select="onSelect" @search="onSearch" @change="onChange">
                        <a-input @pressEnter="onSelect">
                            <a-icon slot="suffix" type="search" class="certain-category-icon" />
                        </a-input>
                    </a-auto-complete>
                </div>
                <hr>
                <span>{{sentence}}</span>
            </div>
        </div>
    </div>
 
</template>
 
<script>
    export default {
        name: "box",
        props: {
            searchType: "",
        },
        data() {
            return {
                sentence: "十里寒塘路,烟花一半醒",
                search: {
                    //placeholder: "搜索..",
                    placeholder: "此搜索框未营业..",
                    // autoFocus: true,
                    backfill: true,
                    value: '',
                    dataSource: [],
                },
            }
        },
        methods: {
            onSearch(searchText) {
                this.dataSource = !searchText ? [] : [searchText, searchText.repeat(2), searchText.repeat(3)];
                console.log("补全..");
            },
            onSelect(value) {
                this.$message.info("这个功能会等到内容足够多的时候再打开..")
                console.log('回车', value);
            },
            onChange(value) {
                console.log('修改', value);
            },
            keyListener(value) {
                console.log('ref', this.$refs.mySearch);
                console.log('键盘', value);
            },
        },
    }
</script>
 
</script>
 
<style lang="less">
 
</style>