checkbox.vue
1008 Bytes
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
/**
* @file
* @author 何文林
* @date 2017/9/26
*/
<template>
<div class="checkwramp" :class="isTrue ? 'active' : ''">
<i class="checkbox iconfont">{{isTrue ? '' : ''}}</i>
<slot></slot>
</div>
</template>
<script>
export default{
props: {
isTrue: {
type: Boolean,
default: false
},
isDisable: {
type: Boolean,
default: false
}
}
}
</script>
<style lang="less" scoped>
.checkwramp{
display: flex;
align-items: center
}
.checkwramp.active{
color: #1caf4c;
i{
border-color: #1caf4c;
}
}
.checkbox{
width: 16px;
height: 16px;
border: 1px solid #7b7b7b;
text-align: center;
line-height: 16px;
font-size: 12px;
border-radius: 4px;
cursor: pointer;
display: inline-block;
overflow: hidden;
box-sizing: border-box;
background: #ffffff;
margin-right: 5px;
}
.checkbox.active{
color: #1caf4c;
border-color: #1caf4c;
}
.checkbox:hover{
color: #1caf4c;
border-color: #1caf4c;
}
</style>