微信小程序开发 wepy使用

时间:2019-11-20 19:48:46   收藏:0   阅读:195

wepy官网:https://tencent.github.io/wepy/document.html,想要了解全面最好去官网,以下只是指出项目里常用地方。

1.页面跳转

(1)//有返回跳转
wepy.navigateTo({
url: "/pages/address_add"
});

(2)//无返回跳转
wepy.switchTab({
url: ‘/pages/shop_cart‘
})

2组件间通信

(1)//指定执行某个组件里的方法

this.$invoke(‘comAddress‘, ‘getLocationInfo‘);

(2)由子组件发起向父组件调用某方法

that.$emit(‘selectCode‘, that.code);

3数据 / 缓存
wepy.$store.dispatch({type: CHANGE_CART, payload: {goodCartList: that.cartList}});

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!