@@ -2,9 +2,10 @@ import { storiesOf } from '@storybook/vue'
2
2
import { action } from '@storybook/addon-actions'
3
3
import { CBox , CTextarea } from '..'
4
4
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 : `
8
9
<CBox w="300px">
9
10
<CTextarea
10
11
v-model="textareaContent"
@@ -17,12 +18,40 @@ storiesOf('UI | Textarea', module).add('Basic Usage', () => ({
17
18
/>
18
19
</CBox>
19
20
` ,
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 ( )
23
28
}
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