loading怎么关闭 vant_按推荐按需引入vant启动服务时依然报找不到vant的两个相关依赖...

"dependencies": {

"axios": "^0.19.0",

"core-js": "^2.6.5",

"vant": "^2.0.9",

"vue": "^2.6.10",

"vue-router": "^3.0.3",

"vuex": "^3.0.1"

},

"devDependencies": {

"@vue/cli-plugin-babel": "^3.9.0",

"@vue/cli-plugin-eslint": "^3.9.0",

"@vue/cli-service": "^3.9.0",

"@vue/eslint-config-prettier": "^4.0.1",

"babel-eslint": "^10.0.1",

"babel-plugin-import": "^1.12.0",

"eslint": "^5.16.0",

"eslint-plugin-vue": "^5.0.0",

"sass": "^1.18.0",

"sass-loader": "^7.1.0",

"vue-template-compiler": "^2.6.10"

}

以上可以看到我的全局dependency中已成功安装vant 2.0.9 而开发环境已成功安装babel-plugin-import 1.12.0

module.exports = {

presets: ["@vue/app"],

plugins: [

['import', {

libraryName: 'vant',

libraryDirectory: 'es',

style: true

}, 'vant']

]

};

而对应的babel.config.js文件也添加了vant的plugin如上图

Primary

import axios from 'axios';

import {Button} from 'vant';

export default {

name: 'contatcList',

components: {

[Button.name] : Button

},

created() {

}

}

最后也在相应的自定义组件ContactList.vue中import且在components中注册并在template中使用 可起服务的时候依然报找不到vant对应的两个依赖 不知道哪位大神能帮忙解答 感激涕零>_<

These dependencies were not found:

* vant/es/button in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0

-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/ContactList.vue?vue&type=script&lang=js&

* vant/es/button/style in ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??

ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/views/ContactList.vue?vue&type=script&lang=js&

To install them, you can run: npm install --save vant/es/button vant/es/button/style

P.S.: 即使我尝试了跑以上推荐的命令 npm install --save vant/es/button vant/es/button/style 依然还是会报错 所以只好post在这里看大家有没有遇到过类似的问题了>_<

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值