zhaoxiaoqiang
2021-07-27 d1fcf1e2e1e9de451550b7ea6835d86ecb94758c
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
<!--
 * @Author: 小明丶
 * @Date: 2020-11-09 09:50:39
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-11-10 11:17:07
 * @Description: 登录样式组件
-->
<template>
    <div class="login-box">
        <div class="h-login">
            <van-icon :name="icon" :size="iconSize"/>
            <input :type="type" v-model="caleValue" :maxlength="max" :placeholder="placeholder">
            <slot name="right-content">
                
            </slot>
        </div>
    </div>
</template>
<script>
export default {
    name:'loginBox',
    props:{
        icon:String,
        iconSize:String,
        type:{
            type:String,
            default:'text'
        },
        max:Number,
        placeholder:String,
        value:[String,Number]
    },
    computed:{
        caleValue:{
            get(){
                return this.value
            },
            set(newValue){
                this.$emit('input', newValue)
            }
        }
    }
}
</script>
<style lang="less" scoped>
.login-box{
    &{
        border-bottom:1px #ebedf0 solid ;
        margin-bottom: 20px;
    }
    .h-login{
        display: flex;
        padding: 11px 16px ;
    }
    input{
        border: 0;
        outline: none;
        background: #fff;
        text-align: left;
    }
}
</style>