Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 39313dc

Browse files
committed
Added size prop to button
1 parent 7c5c5b9 commit 39313dc

File tree

4 files changed

+26
-150
lines changed

4 files changed

+26
-150
lines changed

docs/components/button.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,24 @@
6363
<v-button disabled appearance="default">Default</v-button>
6464
```
6565

66+
<div class="p-3 border rounded-2 my-3">
67+
<v-button size="0" appearance="default">Default</v-button>
68+
<v-button size="1" appearance="default">Default</v-button>
69+
<v-button size="2" appearance="default">Default</v-button>
70+
<v-button size="3" appearance="default">Default</v-button>
71+
<v-button size="4" appearance="default">Default</v-button>
72+
</div>
73+
74+
``` html
75+
<v-button disabled appearance="default">Default</v-button>
76+
```
77+
6678
## Props
6779
Name | Type | Description | Default
6880
---------- | -------- | ----------- | -----
6981
type | String | Button type, 'button' or 'submit' | button
7082
appearance | String | There are 6 options: ['default', 'primary', 'alternative', 'subtle', 'success', 'danger'] | <code>default</code>
83+
size | String | Button size, ['1', '2', '3', '4'] | '3'
7184
disabled | Boolean | Whether button disabled or not | false
7285
loading | Boolean | Whether button in loading state or not | false
7386
icon-first | Boolean | Set to `true` if you want to render icon before text | false

package-lock.json

Lines changed: 4 additions & 149 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"test:unit": "vue-cli-service test:unit"
1919
},
2020
"devDependencies": {
21-
"@modulist/css": "0.0.10",
21+
"@modulist/css": "0.0.15",
2222
"@vue/cli-plugin-babel": "^3.5.0",
2323
"@vue/cli-plugin-eslint": "^3.5.0",
2424
"@vue/cli-plugin-unit-jest": "^3.5.0",

src/components/Button/main.vue

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ export default {
2222
return ['default', 'primary', 'alternative', 'subtle', 'success', 'danger'].indexOf(appearance) > -1;
2323
},
2424
},
25+
size: {
26+
type: String,
27+
default: '3',
28+
validator(appearance) {
29+
return ['0', '1', '2', '3', '4'].indexOf(appearance) > -1;
30+
},
31+
},
2532
loading: {
2633
type: Boolean,
2734
default: false,
@@ -39,6 +46,7 @@ export default {
3946
classes() {
4047
return [
4148
`button--${this.appearance}`,
49+
`button--size-${this.size}`,
4250
{ 'button--loading': this.loading },
4351
{ 'button--icon-first': this.iconFirst },
4452
];

0 commit comments

Comments
 (0)