1. Problem description
1.bug
2. Local settings
Details > Local Settings There is no "use npm module" option (I can't find it anyway)
Two, the cause of the problem
After following the official documents and steps, the file configuration is as follows:
Open the miniprogram_npm folder
At this point the problem becomes obvious
"usingComponents": { "van-button": "@vant/weapp/button/index" }
This way of writing is wrong
3. Solutions
correct spelling
"usingComponents": {
"van-button": "/miniprogram_npm/vant-weapp/button/index"
}
4. Supplement
I see other blogs have this setting
After I tried it, I found that it is not necessary,
After importing in the correct way, there will be no error even if the above configuration is not used (I have no bugs)