一、问题
在 vue 文件中的 <style></style>用前导符 "~" 引入资源时报错如下
error in ./src/components/VuePreview/preview.vue
Module build failed: Error: Failed to find '~photoswipe/dist/photoswipe.css'
二、解决
应该在 <script></script> 中引入,且去除前导符 ~ ,如下
import 'photoswipe/dist/photoswipe.css'
import 'photoswipe/dist/default-skin/default-skin.css'
但是,为什么呢?
网友评论