Skip to content
This repository was archived by the owner on Sep 20, 2024. It is now read-only.

Commit c95f9d1

Browse files
committed
chore: added story for button with loading
1 parent b51eb11 commit c95f9d1

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<theme-provider :theme="theme" :icons="$kiwi.icons">
33
<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>
55
</div>
66
</theme-provider>
77
</template>

stories/3-Button.stories.js

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,28 @@ storiesOf('UI | Button', module)
5555
`,
5656
methods: { action: action('Button Clicked') }
5757
}))
58-
.add('Ripple', () => ({
58+
.add('With Loading', () => ({
5959
components: { Button },
6060
template: `
6161
<div>
62-
<Button @click="action" ripple variant-color="orange">No rounded</Button>
62+
<Button :variant-color="variantColor" @click="setLoading" :is-loading="loading"> {{ buttonText }} </Button>
6363
</div>
6464
`,
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+
}
6982
}))

0 commit comments

Comments
 (0)