简体   繁体   English

尝试将 Vuetify 添加到故事书 Vue.js(无法解析“@/plugins/vuetify”)

[英]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.我正在尝试将 Vuetify 集成到我的故事书中,但出现错误。 It cannot find the plugin file.它找不到插件文件。

I try to follow this tutorial: https://github.com/nidkil/vuetify-with-storybook我尝试按照本教程进行操作: 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代码源位于: 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/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/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/.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 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.我试图通过遵循一些教程和 Stack Overflow 帖子来解决问题,但我做不到。

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.最后我成功了,通过启动视图ui(终端中的“vue ui”),从界面安装插件“view-cli-plugin-vuetify-storybook”。 Once installed, I add the "js-beautify" module ("npm install --save js-beautify").安装后,我添加“js-beautify”模块(“npm install --save js-beautify”)。 Et voilà !等等! :D :D

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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