From 83cd54b9d88db423f324e1e291e1c5149c4a9bb2 Mon Sep 17 00:00:00 2001 From: hypnos Date: Wed, 20 Sep 2017 01:29:08 +0300 Subject: [PATCH 1/2] CLI: Use actions in sample stories for vue --- lib/cli/generators/VUE/template/stories/index.js | 5 +++-- lib/cli/test/snapshots/vue/stories/index.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/cli/generators/VUE/template/stories/index.js b/lib/cli/generators/VUE/template/stories/index.js index b6f10120c7db..4871526c77ac 100644 --- a/lib/cli/generators/VUE/template/stories/index.js +++ b/lib/cli/generators/VUE/template/stories/index.js @@ -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'; @@ -14,10 +15,10 @@ storiesOf('Button', module) .add('with text', () => ({ components: { MyButton }, template: 'Hello Button', - methods: { action: linkTo('clicked') }, + methods: { action: action('clicked') }, })) .add('with some emoji', () => ({ components: { MyButton }, template: '😀 😎 👍 💯', - methods: { action: linkTo('clicked') }, + methods: { action: action('clicked') }, })); diff --git a/lib/cli/test/snapshots/vue/stories/index.js b/lib/cli/test/snapshots/vue/stories/index.js index b6f10120c7db..4871526c77ac 100644 --- a/lib/cli/test/snapshots/vue/stories/index.js +++ b/lib/cli/test/snapshots/vue/stories/index.js @@ -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'; @@ -14,10 +15,10 @@ storiesOf('Button', module) .add('with text', () => ({ components: { MyButton }, template: 'Hello Button', - methods: { action: linkTo('clicked') }, + methods: { action: action('clicked') }, })) .add('with some emoji', () => ({ components: { MyButton }, template: '😀 😎 👍 💯', - methods: { action: linkTo('clicked') }, + methods: { action: action('clicked') }, })); From c77777da31ad3d1ce441db440022820fcc7c9787 Mon Sep 17 00:00:00 2001 From: hypnos Date: Sat, 23 Sep 2017 01:37:16 +0300 Subject: [PATCH 2/2] Fix actions in `SFC_VUE` template --- lib/cli/generators/SFC_VUE/template/src/stories/MyButton.vue | 3 ++- lib/cli/test/snapshots/sfc_vue/src/stories/MyButton.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/cli/generators/SFC_VUE/template/src/stories/MyButton.vue b/lib/cli/generators/SFC_VUE/template/src/stories/MyButton.vue index 6510d4d778c5..4ad8ff85f08c 100644 --- a/lib/cli/generators/SFC_VUE/template/src/stories/MyButton.vue +++ b/lib/cli/generators/SFC_VUE/template/src/stories/MyButton.vue @@ -7,9 +7,10 @@