How do I access the Vue3 Application Instance from a Storybook Story?

Viewed 417

I have a simple component that requires the following to setup globally...

const app = createApp(App);
app.config.globalProperties.Icons = Icons;

However, when I am constructing my Storybook story file I am unsure how to access the config property of the Vue Application Instance.

Is there a way I can set this in a Vue3 Storybook Story?

1 Answers

Per the docs

  1. created file named storybook/preview.js

  2. Added the following....

    import { app } from '@storybook/vue3';
    app.config.globalProperties.Icons = Icons;
    
Related