1、添加项目名称,选择文件路径
2、选择默认模板
3、Vue版本选择(若无其他需求,点击创建即可)
安装完成后,项目中会多出一个依赖项,也代表安装成功
以下为组件的全局注册,可根据需求按需导入组件:
"usingComponents": { "van-action-sheet": "/wxcomponents/vant/action-sheet/index", "van-area": "/wxcomponents/vant/area/index", "van-button": "/wxcomponents/vant/button/index", "van-card": "/wxcomponents/vant/card/index", "van-cell": "/wxcomponents/vant/cell/index", "van-cell-group": "/wxcomponents/vant/cell-group/index", "van-checkbox": "/wxcomponents/vant/checkbox/index", "van-checkbox-group": "/wxcomponents/vant/checkbox-group/index", "van-col": "/wxcomponents/vant/col/index", "van-dialog": "/wxcomponents/vant/dialog/index", "van-field": "/wxcomponents/vant/field/index", "van-goods-action": "/wxcomponents/vant/goods-action/index", "van-goods-action-icon": "/wxcomponents/vant/goods-action-icon/index", "van-goods-action-button": "/wxcomponents/vant/goods-action-button/index", "van-icon": "/wxcomponents/vant/icon/index", "van-loading": "/wxcomponents/vant/loading/index", "van-nav-bar": "/wxcomponents/vant/nav-bar/index", "van-notice-bar": "/wxcomponents/vant/notice-bar/index", "van-notify": "/wxcomponents/vant/notify/index", "van-panel": "/wxcomponents/vant/panel/index", "van-popup": "/wxcomponents/vant/popup/index", "van-progress": "/wxcomponents/vant/progress/index", "van-radio": "/wxcomponents/vant/radio/index", "van-radio-group": "/wxcomponents/vant/radio-group/index", "van-row": "/wxcomponents/vant/row/index", "van-search": "/wxcomponents/vant/search/index", "van-slider": "/wxcomponents/vant/slider/index", "van-stepper": "/wxcomponents/vant/stepper/index", "van-steps": "/wxcomponents/vant/steps/index", "van-submit-bar": "/wxcomponents/vant/submit-bar/index", "van-swipe-cell": "/wxcomponents/vant/swipe-cell/index", "van-switch": "/wxcomponents/vant/switch/index", "van-tab": "/wxcomponents/vant/tab/index", "van-tabs": "/wxcomponents/vant/tabs/index", "van-tabbar": "/wxcomponents/vant/tabbar/index", "van-tabbar-item": "/wxcomponents/vant/tabbar-item/index", "van-tag": "/wxcomponents/vant/tag/index", "van-toast": "/wxcomponents/vant/toast/index", "van-transition": "/wxcomponents/vant/transition/index", "van-tree-select": "/wxcomponents/vant/tree-select/index", "van-datetime-picker": "/wxcomponents/vant/datetime-picker/index", "van-rate": "/wxcomponents/vant/rate/index", "van-collapse": "/wxcomponents/vant/collapse/index", "van-collapse-item": "/wxcomponents/vant/collapse-item/index", "van-picker": "/wxcomponents/vant/picker/index" }
如此,即完成了Vant组件库的引入!
到此这篇关于uni-app项目中引入Vant UI组件库的文章就介绍到这了,更多相关uni-app引入Vant UI组件库内容请搜索插件窝以前的文章或继续浏览下面的相关文章希望大家以后多多支持插件窝!