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

Commit 710e43a

Browse files
committed
fix(textarea): add storybook example with event listener
1 parent 83ab8c5 commit 710e43a

File tree

1 file changed

+40
-11
lines changed

1 file changed

+40
-11
lines changed

packages/chakra-ui-core/src/CTextarea/CTextarea.stories.js

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import { storiesOf } from '@storybook/vue'
22
import { action } from '@storybook/addon-actions'
33
import { CBox, CTextarea } from '..'
44

5-
storiesOf('UI | Textarea', module).add('Basic Usage', () => ({
6-
components: { CBox, CTextarea },
7-
template: `
5+
storiesOf('UI | Textarea', module)
6+
.add('Basic Usage', () => ({
7+
components: { CBox, CTextarea },
8+
template: `
89
<CBox w="300px">
910
<CTextarea
1011
v-model="textareaContent"
@@ -17,12 +18,40 @@ storiesOf('UI | Textarea', module).add('Basic Usage', () => ({
1718
/>
1819
</CBox>
1920
`,
20-
data () {
21-
return {
22-
textareaContent: 'Jonathan Bakebwa is awesome'
21+
data () {
22+
return {
23+
textareaContent: 'Jonathan Bakebwa is awesome'
24+
}
25+
},
26+
methods: {
27+
action: action()
2328
}
24-
},
25-
methods: {
26-
action: action()
27-
}
28-
}))
29+
}))
30+
.add('Basic Usage with Event', () => ({
31+
components: { CBox, CTextarea },
32+
template: `
33+
<CBox w="300px">
34+
<CTextarea
35+
v-model="textareaContent"
36+
maxWidth="sm"
37+
mx="auto"
38+
mt="2"
39+
placeholder="Here is a sample placeholder"
40+
size="md"
41+
:value="textareaContent"
42+
@change="handleChange"
43+
/>
44+
</CBox>
45+
`,
46+
data () {
47+
return {
48+
textareaContent: 'Jonathan Bakebwa is awesome'
49+
}
50+
},
51+
methods: {
52+
action: action(),
53+
handleChange (e) {
54+
this.textareaContent = 'You are beautiful :)'
55+
}
56+
}
57+
}))

0 commit comments

Comments
 (0)