最近想学习一下小程序的开发,所以在网上下载了一个开源的小程序,但是编译时出现了如下报错:
```
Error: module "pages/kuaidi/@vant/weapp/toast/toast.js" is not defined
at require (VM19 WAService.js:19)
at VM19 WAService.js:19
at VM213 index.js:4
at require (VM19 WAService.js:19)
at <anonymous>:1998:9
at doWhenAllScriptLoaded (<anonymous>:2465:21)
at Object.scriptLoaded (<anonymous>:2485:5)
at Object.<anonymous> (<anonymous>:2510:22)
```
我检查了导入路径:
```
import Toast from '@vant/weapp/toast/toast';
```
检查了.wxml文件,也检查了app.json配置的都正确,也重新在工具里构建了npm,还是编译不过,请问谁知道这个问题要怎么解决吗?
@vant/weapp/toast/index
然后再wxml上绑定个van-toast
// 第一步:在你的页面js里引用
import Toast from '@vant/weapp/toast/toast';
// 第二步:在你的页面json里引用
"usingComponents": {
"van-toast": "@vant/weapp/toast/index"
}
// 第三步:在你的wxml上引用
<van-toast id="van-toast" />
构建npm 提示什么?
npm install 模块安装了么?