diff options
Diffstat (limited to 'storybook')
-rw-r--r-- | storybook/config/addons/make_container/index.js | 12 | ||||
-rw-r--r-- | storybook/config/preview.js | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/storybook/config/addons/make_container/index.js b/storybook/config/addons/make_container/index.js new file mode 100644 index 00000000000..2bc7fa92b8a --- /dev/null +++ b/storybook/config/addons/make_container/index.js @@ -0,0 +1,12 @@ +/** + * Return a story decorator function, which wraps the given story in a `div` + * element with the given `style` attributes. + * + * @param {object} style The style attribute to apply to the container. + * @return {function} The story decorator. + */ +export const makeContainer = (style) => (Story) => ({ + render(h) { + return h('div', { style }, [h(Story())]); + }, +}); diff --git a/storybook/config/preview.js b/storybook/config/preview.js index fc04623071a..e31f36ca70e 100644 --- a/storybook/config/preview.js +++ b/storybook/config/preview.js @@ -1,6 +1,7 @@ // Some modules read window.gon on initialization thus we need to define this object before anything else import './gon'; import Vue from 'vue'; +import VueApollo from 'vue-apollo'; import translateMixin from '~/vue_shared/translate'; import { initializeGitLabAPIAccess } from './addons/gitlab_api_access/preview'; @@ -13,6 +14,7 @@ const stylesheetsRequireCtx = require.context( initializeGitLabAPIAccess(); translateMixin(Vue); +Vue.use(VueApollo); stylesheetsRequireCtx('./application.scss'); stylesheetsRequireCtx('./application_utilities.scss'); |