在制作中,我可以使用Sweet Alert,但是当我放置网站时,我收到此错误:
未捕获的ReferenceError:未定义swal
我跑了 npm install sweetalert
并将这两行添加到index.html的头部:
<SCRIPT SRC = “node_modules / sweetalert / DIST / sweetalert.min.js”> <链接的rel = “样式表的” href = “node_modules / sweetalert / DIST / sweetalert.css”>
他们应该在哪里?他们应该在其他地方/无处吗?
页面加载后,Chrome的控制台会显示以下三个错误:
GET https://wfolly.firebaseapp.com/node_modules/sweetalert/dist/sweetalert.css wfolly.firebaseapp.com/:24 GET https://wfolly.firebaseapp.com/node_modules/sweetalert/dist/sweetalert.min . js wfolly.firebaseapp.com/:25 GET https://wfolly.firebaseapp.com/node_modules/sweetalert/dist/sweetalert.css
我已经尝试使用和不使用node_modules / sweetalert目录来部署网站 .
我是新手 . 可能存在一个基本错误 .
想法欢迎 .
1 回答
如果你保持
在头部保留我对CSS所做的更改,但用脚本替换
有用!
让我们花一点时间来感谢那些因为耐心和慷慨而对这个问题进行投票的人们 .