forked from didi/mand-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbox.vue
More file actions
79 lines (73 loc) · 1.42 KB
/
box.vue
File metadata and controls
79 lines (73 loc) · 1.42 KB
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
<template>
<div
class="md-check-base-box"
:class="{
'is-disabled': disabled,
'is-checked': isChecked
}"
>
<slot></slot>
<md-tag
v-if="isChecked"
size="tiny"
shape="quarter"
type="fill"
>
<md-icon name="right"></md-icon>
</md-tag>
</div>
</template>
<script>import Tag from '../tag'
import Icon from '../icon'
export default {
name: 'md-check-base-box',
components: {
[Tag.name]: Tag,
[Icon.name]: Icon,
},
props: {
label: {
type: String,
default: '',
},
disabled: {
type: Boolean,
default: false,
},
isChecked: {
type: Boolean,
default: false,
},
},
}
</script>
<style lang="stylus">
.md-check-base-box
position relative
display inline-block
text-align center
color checkbox-color
font-size checkbox-font-size
padding v-gap-sm h-gap-md
border 1px solid checkbox-border-color
border-radius checkbox-border-radius
box-sizing border-box
overflow hidden
&.is-checked
color checkbox-active-color
border-color checkbox-active-border-color
&.is-disabled
color checkbox-active-color
border-color checkbox-active-border-color
opacity 0.6
&.is-disabled
color checkbox-disabled-color
border-color checkbox-disabled-color
.md-tag
position absolute
top 0
right 0
.quarter-bg
background-color checkbox-active-color
</style>