@arnoldo.moen
To make the storybook addon 'addon-links' work for Vue.js, you can follow these steps:
1
|
npm install --save-dev @storybook/addon-links |
1
|
import '@storybook/addon-links/register'; |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import { storiesOf } from '@storybook/vue'; import { linkTo } from '@storybook/addon-links'; storiesOf('Component', module) .add('Button', () => ({ template: '<button @click="linkTo('Another Component')">Go to another component</button>', methods: { linkTo } })) .add('Another Component', () => ({ template: '<div>Another Component</div>' })); |
By following these steps, you should be able to make the addon-links work for Vue.js in your Storybook setup.