liangjin
2021-04-23 7759b52788c81e0724350642ed62d40b467c365b
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
<!--
 * @Author: 小明丶
 * @Date: 2019-08-30 10:21:30
 * @LastEditors: 小明丶
 * @LastEditTime: 2019-09-06 16:06:52
 * @Description: 
 -->
/*
* @Author: hzq
* @Date: 2018-08-08 15:12:59
* @Last Modified by: hzq
* @Last Modified time: 2018-08-10 16:13:12
* @文件说明:圆角搜索输入框组件--实时搜索0.2s延迟 回调函数:on-value,返回输入框的值
* @使用方式: <f-search placeholder="渠道名称/负责人姓名/负责人电话" @on-value="onValue"></f-search>,可参考:views/agent/channelManagement.vue
*/
<template>
    <div class="f-search">
        <group>
            <x-input ref="inputDom" :placeholder="placeholder" v-model="queryStr" :debounce="200" @on-change="inputChange" :show-clear="true">
                <i slot="label" class="iconfont scene_Staging-normal"></i>
            </x-input>
        </group>
    </div>
</template>
 
<script>
    export default {
        name: 'f-search',
        props: {
            placeholder: {
                //暗提示文字
                type: String,
                default: '请输入'
            },
            queryStr: {
                type: String
            }
        },
        methods: {
            inputChange(value) {
                this.$emit('on-value', value.trim());
            },
        },
        deactivated() {
            this.$refs.inputDom.reset();
        }
    };
 
</script>
 
<style lang="less" scoped>
    .f-search {
        & /deep/ .weui-cells {
            height: 32px;
            margin: 10px 12px;
            border-radius: 50px;
 
            &::after,
            &::before {
                display: none;
            }
 
            .weui-cell {
                height: 32px;
                padding: 5px 15px;
 
                &::after {
                    display: none;
                }
 
                .scene_Staging-normal {
                    margin-right: 10px;
                    color: @color-text-placeholder;
                }
            }
 
        }
    }
 
</style>