Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Use actions in sample stories for vue + fix them in SFC_VUE template #1867

Merged
merged 6 commits into from
Sep 25, 2017
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/cli/generators/SFC_VUE/template/src/stories/MyButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
<script>
export default {
name: 'my-button',

methods: {
onClick () {
this.$emit('click');
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions lib/cli/generators/VUE/template/stories/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { storiesOf } from '@storybook/vue';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';

import MyButton from './MyButton';
Expand All @@ -14,10 +15,10 @@ storiesOf('Button', module)
.add('with text', () => ({
components: { MyButton },
template: '<my-button @click="action">Hello Button</my-button>',
methods: { action: linkTo('clicked') },
methods: { action: action('clicked') },
}))
.add('with some emoji', () => ({
components: { MyButton },
template: '<my-button @click="action">😀 😎 👍 💯</my-button>',
methods: { action: linkTo('clicked') },
methods: { action: action('clicked') },
}));
3 changes: 2 additions & 1 deletion lib/cli/test/snapshots/sfc_vue/src/stories/MyButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
<script>
export default {
name: 'my-button',

methods: {
onClick () {
this.$emit('click');
}
}
}
Expand Down
5 changes: 3 additions & 2 deletions lib/cli/test/snapshots/vue/stories/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { storiesOf } from '@storybook/vue';
import { action } from '@storybook/addon-actions';
import { linkTo } from '@storybook/addon-links';

import MyButton from './MyButton';
Expand All @@ -14,10 +15,10 @@ storiesOf('Button', module)
.add('with text', () => ({
components: { MyButton },
template: '<my-button @click="action">Hello Button</my-button>',
methods: { action: linkTo('clicked') },
methods: { action: action('clicked') },
}))
.add('with some emoji', () => ({
components: { MyButton },
template: '<my-button @click="action">😀 😎 👍 💯</my-button>',
methods: { action: linkTo('clicked') },
methods: { action: action('clicked') },
}));