File tree Expand file tree Collapse file tree 13 files changed +99
-45
lines changed Expand file tree Collapse file tree 13 files changed +99
-45
lines changed Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import GetQueryDemo from './GetQueryDemo.vue'
45
5- const storiesPath = __dirname
6- const notes = require ( './getQuery.md' ) . default
6+ const functionName = 'getQuery'
7+ const functionPath = path . resolve ( __dirname , '..' )
8+ const notes = require ( `./${ functionName } .md` ) . default
79
810const basicDemo = ( ) => ( {
911 components : { StoryTitle, demo : GetQueryDemo } ,
1012 template : `
1113 <div class="container">
12- <story-title stories-path="${ storiesPath } " file-name="GetQueryDemo.vue">
14+ <story-title stories-path="${ functionPath } " file-name="GetQueryDemo.vue">
1315 <template v-slot:title></template>
1416 <template v-slot:intro></template>
1517 </story-title>
Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import UseClickAwayDemo from './UseClickAwayDemo.vue'
45
5- const storiesPath = __dirname
6- const notes = require ( './useClickAway.md' ) . default
6+ const functionName = 'useClickAway'
7+ const functionPath = path . resolve ( __dirname , '..' )
8+ const notes = require ( `./${ functionName } .md` ) . default
79
810const basicDemo = ( ) => ( {
911 components : { StoryTitle, demo : UseClickAwayDemo } ,
1012 template : `
1113 <div class="container">
12- <story-title stories -path="${ storiesPath } " file -name="UseClickAwayDemo.vue">
14+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseClickAwayDemo.vue">
1315 <template v-slot:title></template>
1416 <template v-slot:intro>
1517 <p>
Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import UseHoverDemo from './UseHoverDemo.vue'
45
5- const storiesPath = __dirname
6- const notes = require ( './useHover.md' ) . default
6+ const functionName = 'useHover'
7+ const functionPath = path . resolve ( __dirname , '..' )
8+ const notes = require ( `./${ functionName } .md` ) . default
79
810const basicDemo = ( ) => ( {
911 components : { StoryTitle, demo : UseHoverDemo } ,
1012 template : `
1113 <div class="container">
12- <story-title stories -path="${ storiesPath } " file -name="UseHoverDemo.vue">
14+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseHoverDemo.vue">
1315 <template v-slot:title></template>
1416 <template v-slot:intro>
1517 Try to move the mouse hover the box below to see the emoji change of expression.
Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import UseMediaDemo from './UseMediaDemo.vue'
45import UseMediaAdvancedDemo from './UseMediaAdvancedDemo.vue'
56
6- const storiesPath = __dirname
7- const notes = require ( './useMedia.md' ) . default
7+ const functionName = 'useMedia'
8+ const functionPath = path . resolve ( __dirname , '..' )
9+ const notes = require ( `./${ functionName } .md` ) . default
810
911const basicDemo = ( ) => ( {
1012 components : { StoryTitle, demo : UseMediaDemo } ,
1113 template : `
1214 <div class="container">
13- <story-title stories -path="${ storiesPath } " file -name="UseMediaDemo.vue">
15+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseMediaDemo.vue">
1416 <template v-slot:title></template>
1517 <template v-slot:intro>
1618 <p>
@@ -26,7 +28,7 @@ const advancedDemo = () => ({
2628 components : { StoryTitle, demo : UseMediaAdvancedDemo } ,
2729 template : `
2830 <div class="container">
29- <story-title stories -path="${ storiesPath } " file -name="UseMediaAdvancedDemo.vue">
31+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseMediaAdvancedDemo.vue">
3032 <template v-slot:title>Advanced demo</template>
3133 <template v-slot:intro>
3234 <p>
Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import UseMouseDemo from './UseMouseDemo.vue'
45import UseMouseAdvancedDemo from './UseMouseAdvancedDemo.vue'
56
6- const storiesPath = __dirname
7- const notes = require ( './useMouse.md' ) . default
7+ const functionName = 'useMouse'
8+ const functionPath = path . resolve ( __dirname , '..' )
9+ const notes = require ( `./${ functionName } .md` ) . default
810
911const basicDemo = ( ) => ( {
1012 components : { StoryTitle, demo : UseMouseDemo } ,
1113 template : `
1214 <div class="container">
13- <story-title stories -path="${ storiesPath } " file -name="UseMouseDemo.vue">
15+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseMouseDemo.vue">
1416 <template v-slot:title></template>
1517 <template v-slot:intro></template>
1618 </story-title>
@@ -22,7 +24,7 @@ const advancedDemo = () => ({
2224 components : { StoryTitle, demo : UseMouseAdvancedDemo } ,
2325 template : `
2426 <div class="container">
25- <story-title stories -path="${ storiesPath } " file -name="UseMouseAdvancedDemo.vue">
27+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseMouseAdvancedDemo.vue">
2628 <template v-slot:title>Advanced demo</template>
2729 <template v-slot:intro>
2830 <p>
Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import UseMouseElementDemo from './UseMouseElementDemo.vue'
45
5- const storiesPath = __dirname
6- const notes = require ( './useMouseElement.md' ) . default
6+ const functionName = 'useMouseElement'
7+ const functionPath = path . resolve ( __dirname , '..' )
8+ const notes = require ( `./${ functionName } .md` ) . default
79
810const basicDemo = ( ) => ( {
911 components : { StoryTitle, demo : UseMouseElementDemo } ,
1012 template : `
1113 <div class="container">
12- <story-title stories -path="${ storiesPath } " file -name="UseMouseElementDemo.vue">
14+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseMouseElementDemo.vue">
1315 <template v-slot:title></template>
1416 <template v-slot:intro>
1517 <p>
Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import UseRafFnDemo from './UseRafFnDemo.vue'
45
5- const storiesPath = __dirname
6- const notes = require ( './useRafFn.md' ) . default
6+ const functionName = 'useRafFn'
7+ const functionPath = path . resolve ( __dirname , '..' )
8+ const notes = require ( `./${ functionName } .md` ) . default
79
810const basicDemo = ( ) => ( {
911 components : { StoryTitle, demo : UseRafFnDemo } ,
1012 template : `
1113 <div class="container">
12- <story-title stories -path="${ storiesPath } " file -name="UseRafFnDemo.vue">
14+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseRafFnDemo.vue">
1315 <template v-slot:title></template>
1416 <template v-slot:intro></template>
1517 </story-title>
Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import UseSampleComponentDemo from './UseSampleComponentDemo.vue'
45
5- const storiesPath = __dirname
6- const notes = require ( './useSampleComponent.md' ) . default
6+ const functionName = 'useSampleComponent'
7+ const functionPath = path . resolve ( __dirname , '..' )
8+ const notes = require ( `./${ functionName } .md` ) . default
79
810const basicDemo = ( ) => ( {
911 components : { StoryTitle, demo : UseSampleComponentDemo } ,
1012 template : `
1113 <div class="container">
12- <story-title stories -path="${ storiesPath } " file -name="UseSampleComponentDemo.vue">
14+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseSampleComponentDemo.vue">
1315 <template v-slot:title></template>
1416 <template v-slot:intro></template>
1517 </story-title>
Original file line number Diff line number Diff line change 1+ // import { mount } from '../../helpers/test'
2+ // import { useSampleComponent } from '../../vue-use-kit'
3+
14describe ( 'useSampleComponent' , ( ) => {
25 it ( 'should do something' , ( ) => {
36 // Add test here
Original file line number Diff line number Diff line change 11import { storiesOf } from '@storybook/vue'
2+ import path from 'path'
23import StoryTitle from '../../../helpers/StoryTitle.vue'
34import UseTimeoutDemo from './UseTimeoutDemo.vue'
45
5- const storiesPath = __dirname
6- const notes = require ( './useTimeout.md' ) . default
6+ const functionName = 'useTimeout'
7+ const functionPath = path . resolve ( __dirname , '..' )
8+ const notes = require ( `./${ functionName } .md` ) . default
79
810const basicDemo = ( ) => ( {
911 components : { StoryTitle, demo : UseTimeoutDemo } ,
1012 template : `
1113 <div class="container">
12- <story-title stories -path="${ storiesPath } " file -name="UseTimeoutDemo.vue">
14+ <story-title function -path="${ functionPath } " source-name=" ${ functionName } " demo -name="UseTimeoutDemo.vue">
1315 <template v-slot:title></template>
1416 <template v-slot:intro></template>
1517 </story-title>
You can’t perform that action at this time.
0 commit comments