This repository was archived by the owner on Sep 20, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<theme-provider :theme =" theme" :icons =" $kiwi.icons" >
3
3
<div class =" root" >
4
- <Button size = " lg " variant-color =" blue" @click =" setLoading" :is-loading =" loading" > Button </Button >
4
+ <Button variant-color =" blue" @click =" setLoading" :is-loading =" loading" > Button </Button >
5
5
</div >
6
6
</theme-provider >
7
7
</template >
Original file line number Diff line number Diff line change @@ -55,15 +55,28 @@ storiesOf('UI | Button', module)
55
55
` ,
56
56
methods : { action : action ( 'Button Clicked' ) }
57
57
} ) )
58
- . add ( 'Ripple ' , ( ) => ( {
58
+ . add ( 'With Loading ' , ( ) => ( {
59
59
components : { Button } ,
60
60
template : `
61
61
<div>
62
- <Button @click="action" ripple variant-color="orange">No rounded </Button>
62
+ <Button :variant-color="variantColor" @click="setLoading" :is-loading="loading"> {{ buttonText }} </Button>
63
63
</div>
64
64
` ,
65
- methods : { action : action ( 'Button Clicked' ) }
66
- // mounted () {
67
- // console.log({ instance: this.$options.components })
68
- // }
65
+ data ( ) {
66
+ return {
67
+ loading : false ,
68
+ buttonText : 'Save settings' ,
69
+ variantColor : 'blue'
70
+ }
71
+ } ,
72
+ methods : {
73
+ setLoading ( ) {
74
+ this . loading = true
75
+ setTimeout ( ( ) => {
76
+ this . loading = false
77
+ this . buttonText = 'Success'
78
+ this . variantColor = 'green'
79
+ } , 1500 )
80
+ }
81
+ }
69
82
} ) )
You can’t perform that action at this time.
0 commit comments