mpvue+vant app搭建小程序 mpvue+vant app搭建微信小程序的方法步骤
hirCodd 人气:0mpvue使用
# 全局安装 vue-cli $ npm install --global vue-cli # 创建一个基于 mpvue-quickstart 模板的新项目 $ vue init mpvue/mpvue-quickstart my-project # 安装依赖 $ cd my-project $ npm install # 启动构建 $ npm run dev
vant使用
yarn add vant # 将node_modules下的vant-weapp下的dist目录复制到static下的vant目录即可调用
vant调用
main.json中调用
{ "navigationBarTitleText": "Home", "usingComponents": { "van-button": "../../static/vant/button/index", "van-search": "../../static/vant/search/index", "van-tabbar": "../../static/vant/tabbar/index", "van-tabbar-item": "../../static/vant/tabbar-item/index", } }
index.vue中使用
<van-search placeholder="请输入搜索关键词" use-action-slot bind:search="onSearch" > <view slot="action" bind:tap="onSearch">搜索</view> </van-search>
加载全部内容