美文网首页
Failed to find '~photoswipe/dist

Failed to find '~photoswipe/dist

作者: 仰简 | 来源:发表于2020-01-15 17:50 被阅读0次

一、问题

在 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'

但是,为什么呢?

相关文章

网友评论

      本文标题:Failed to find '~photoswipe/dist

      本文链接:https://www.haomeiwen.com/subject/fwvhyctx.html