diff --git a/app/vue/src/client/preview/index.js b/app/vue/src/client/preview/index.js index d0a3ba130b6..b859c3dd1c8 100644 --- a/app/vue/src/client/preview/index.js +++ b/app/vue/src/client/preview/index.js @@ -13,7 +13,12 @@ const decorateStory = (getStory, decorators) => decorators.reduce( (decorated, decorator) => context => { const story = () => decorated(context); - const decoratedStory = decorator(story, context); + let decoratedStory = decorator(story, context); + + if (typeof decoratedStory === 'string') { + decoratedStory = { template: decoratedStory }; + } + decoratedStory.components = decoratedStory.components || {}; decoratedStory.components.story = createWrapperComponent(story()); return decoratedStory; diff --git a/examples/vue-kitchen-sink/src/stories/__snapshots__/core-template.stories.storyshot b/examples/vue-kitchen-sink/src/stories/__snapshots__/core-template.stories.storyshot new file mode 100644 index 00000000000..7f9ee9188fc --- /dev/null +++ b/examples/vue-kitchen-sink/src/stories/__snapshots__/core-template.stories.storyshot @@ -0,0 +1,10 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Storyshots Core|Template string only 1`] = ` + +`; diff --git a/examples/vue-kitchen-sink/src/stories/core-template.stories.js b/examples/vue-kitchen-sink/src/stories/core-template.stories.js new file mode 100644 index 00000000000..8acb4bd11b0 --- /dev/null +++ b/examples/vue-kitchen-sink/src/stories/core-template.stories.js @@ -0,0 +1,6 @@ +import { storiesOf } from '@storybook/vue'; + +storiesOf('Core|Template', module).add( + 'string only', + () => 'A Button with square edges' +);