[Vuejs]-Why is Element-plus not working inside storybook?

1👍

Add these code to storybook’s preview.js

import { app } from '@storybook/vue3'; //I use Vue3
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';

app.use(ElementPlus);
👤GreatC

2👍

There’s a slight change in Storybook 7 onwards, since it doesn’t export
app anymore. Do this instead:

import {setup} from '@storybook/vue3'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

setup((app) => {
  app.use(ElementPlus)
})

Leave a comment