Hi, I wasn't able to make work decorators when using Vue Stories and the documentation only reference an react example.
Are those supported?
close due to released v3.2.8
https://github.com/storybooks/storybook/releases/tag/v3.2.8
@kazupon I can't find any documentation for how to actually _use_ decorators with Vue...
@smiller171, for decorators with Vue, try:
// .storybook/stories/index.js
import YourButton from 'path/to/YourButton.vue'
function Reded() {
return {
template: '<div style="color: red;"><story/></div>',
}
}
storiesOf('YourButton', module)
.addDecorator(Reded)
.add('default form', () => ({
components: {YourButton },
template: '<YourButton />',
}))
This should be added to the documentation. It was actually an effort to find this here.
For anyone looking for a solution similar to the one shown in the docs, I solved with:
import { addDecorator } from '@storybook/vue';
// Decorator to center-align all stories
addDecorator(() => ({
template: '<div style="textAlign: center"><story/></div>',
}));
@adi-zz This is good to add a decorator in my story but what about for pre-existing decorators in scss files.
For example, in Vue.js I have @import "~theme/colors.scss";
, which returns me the error: Module parse failed: Unexpected character '@'
Most helpful comment
This should be added to the documentation. It was actually an effort to find this here.
For anyone looking for a solution similar to the one shown in the docs, I solved with: