简体   繁体   中英

Trying to add Vuetify to storybook Vue.js (can't resolve '@/plugins/vuetify')

I am trying to integrate Vuetify into my storybook, but I have an error. It cannot find the plugin file.

I try to follow this tutorial: https://github.com/nidkil/vuetify-with-storybook

ERROR in ./.storybook/config.js
Module not found: Error: Can't resolve '@/plugins/vuetify' in '[...]\app\.storybook'
  @ ./.storybook/config.js 11: 0-27
  @ multi ./node_modules/@storybook/core/dist/server/common/polyfills.js ./node_modules/@storybook/core/dist/server/preview/globals.js ./.storybook/config.js (webpack) - hot middleware / Client.js? reload = true & quiet = true

The code source is located here: https://github.com/TheSkay/skay.photography-front-end/tree/landing-page-template

app/src/plugins/vuetify.js : https://github.com/TheSkay/skay.photography-front-end/blob/landing-page-template/app/src/plugins/vuetify.js

app/.storybook/config.js : https://github.com/TheSkay/skay.photography-front-end/blob/landing-page-template/app/.storybook/config.js

app/.storybook/webpack.config.js : https://github.com/TheSkay/skay.photography-front-end/blob/landing-page-template/app/.storybook/webpack.config.js

app/src/plugins/vuetify.js : https://github.com/TheSkay/skay.photography-front-end/blob/landing-page-template/app/src/plugins/vuetify.js

I tried to solve the problem by following some tutorials and Stack Overflow posts, but I can't do it.

Thanks!

Finally I succeeded, by starting the view ui ("vue ui" in the terminal), installing the plugin "view-cli-plugin-vuetify-storybook" from the interface. Once installed, I add the "js-beautify" module ("npm install --save js-beautify"). Et voilà ! :D

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM