@@ -2,9 +2,10 @@ import { storiesOf } from '@storybook/vue'
22import { action } from '@storybook/addon-actions'
33import { 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