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

时间:2020-01-05 20:13:50

标签: javascript vue.js webpack vuetify.js storybook

我正在尝试将Vuetify集成到我的故事书中,但是出现错误。无法找到插件文件。

我尝试遵循本教程: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

代码源位于: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

我试图通过遵循一些教程和Stack Overflow帖子来解决问题,但我做不到。

谢谢!

1 个答案:

答案 0 :(得分:1)

最后,我通过启动view ui(终端中的“ vue ui”)成功地从界面安装了插件“ view-cli-plugin-vuetify-storybook”。安装后,我添加“ js-beautify”模块(“ npm install --save js-beautify”)。等等! :D