Skip to content

Commit

Permalink
Merge pull request #19999 from storybookjs/shilman/19200-document-vue…
Browse files Browse the repository at this point in the history
…3-setup-fn

Document vue3 setup export in MIGRATION.md
  • Loading branch information
shilman authored Nov 29, 2022
2 parents 8e52608 + 325c0c2 commit 4ff17a7
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
- [From version 6.5.x to 7.0.0](#from-version-65x-to-700)
- [Alpha release notes](#alpha-release-notes)
- [7.0 breaking changes](#70-breaking-changes)
- [Vue3 replaced app export with setup](#vue3-replaced-app-export-with-setup)
- [removed auto injection of @storybook/addon-actions decorator](#removed-auto-injection-of-storybookaddon-actions-decorator)
- [register.js removed](#registerjs-removed)
- [Change of root html IDs](#change-of-root-html-ids)
Expand Down Expand Up @@ -259,6 +260,30 @@ In the meantime, these migration notes are the best available documentation on t

### 7.0 breaking changes

#### Vue3 replaced app export with setup

In 6.x `@storybook/vue3` exported a Vue application instance called `app`. In 7.0, this has been replaced by a `setup` function that can be used to initialize the application in your `.storybook/preview.js`:

Before:

```js
import { app } from '@storybook/vue3';
import Button from './Button.vue';

app.component('GlobalButton', Button);
```

After:

```js
import { setup } from '@storybook/vue3';
import Button from './Button.vue';

setup((app) => {
app.component('GlobalButton', Button);
});
```

#### removed auto injection of @storybook/addon-actions decorator

The `withActions` decorator is no longer automatically added to stories. This is because it is really only used in the html renderer, for all other renderers it's redundant.
Expand Down

0 comments on commit 4ff17a7

Please sign in to comment.