lijh
2022-01-14 d629d9ee09eb91be19fd21f04f78a89f7d837c3a
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<template>
    <div class="layui-row">
        <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>
 
        <!--     <ul class="layui-nav ">
                <li class="layui-nav-item blog-displayIn-minScreen">
                    <i class="layui-icon layui-icon-spread-left">Home</i>
                </li>
                <li class="layui-nav-item blog-displayIn-BidScreen">
                    <legend> Home</legend>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">文章<span class="layui-nav-more"></span></a>
                    <dl class="layui-nav-child layui-anim layui-anim-upbit">
                        <dd><a href="#">按时间线</a></dd>
                        <dd><a href="#">按Tag</a></dd>
                        <dd><a href="#">按热度</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="#">曲谱/曲库</a></li>
                <li class="layui-nav-item">
                    <a href="javascript:;">动漫<span class="layui-nav-more"></span></a>
                    <dl class="layui-nav-child layui-anim layui-anim-upbit">
                        <dd><a href="#">番</a></dd>
                        <dd><a href="#">电影</a></dd>
                        <dd><a href="#">声优</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item blog-displayIn-BidScreen"><a href="#">第九艺术</a></li>
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item blog-displayIn-BidScreen">
                    <input type="text" placeholder="搜索一下" value="" class="layui-input">
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        <img src="http://t.inleft.com/share/media_photo/xigong.png" class="layui-nav-img">
                        inleft
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="#">About</a></dd>
                        <dd><a href="#">时间轴</a></dd>
                    </dl>
                </li>
            </ul> -->
    </div>
 
</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>
 
</script>
 
<style lang="less">
 
</style>