-
-
Notifications
You must be signed in to change notification settings - Fork 249
/
MyButton.vue
86 lines (64 loc) · 1.33 KB
/
MyButton.vue
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
<template>
<button class="button" :class="{
button_alert: alert,
button_success: success
}">
<slot></slot>
</button>
</template>
<docs>
## Vue docs blocks
This docs are inside `MyButton.vue` component.
### :smile: Usage
Buttons allow users to take actions, and make choices, with a single tap. Supports all default HTML Button properties. See Material Design Button for UI/UX information.
Button variants could be imported separately.
```js
import { OutlinedButton, ContainedButton, TextButton } from 'Button';
```
<!-- PROPS -->
</docs>
<script>
export default {
props: ['variant'],
data() {
return {
success: this.$props.variant === 'success',
warning: this.$props.variant === 'warning',
alert: this.$props.variant === 'alert',
};
},
};
</script>
<style>
.button {
font-size: 16px;
font-weight: bold;
cursor: pointer;
padding: 8px 12px;
outline: none;
border-width: 2px;
border-style: solid;
border-color: black;
border-radius: 8px;
color: rgba(0, 0, 0, 0.96);
}
.button:hover {
background: yellow;
border-width: 3px;
padding: 7px 11px;
}
.button:active {
background: yellow;
border-width: 4px;
padding: 6px 10px;
}
.button_success {
border-color: green;
}
.button_alert {
border-color: red;
}
.button_warning {
border-color: orange;
}
</style>