当前位置: 移动技术网 > IT编程>脚本编程>vue.js > mpvue+vant app搭建微信小程序的方法步骤

mpvue+vant app搭建微信小程序的方法步骤

2019年03月17日  | 移动技术网IT编程  | 我要评论

www.kubotv.cc,刺杀目标1,8090师生恋

mpvue使用

# 全局安装 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>

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持移动技术网。

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网