@litewash/wash-ui-core
v0.0.1
Published
外部调用示例 ========== xxxPage.wxml: --------------- ```html <view> <button bindtap="onClick">提交</button> <block wx:for="{{xxxs}}" wx:key="xxxId" wx:for-item="xxx"> <view>"{{xxx.xxxId}}"</view> <view>"{{xxx.yyy}}"</view> <view>"
Downloads
6
Readme
外部调用示例
xxxPage.wxml:
<view>
<button bindtap="onClick">提交</button>
<block wx:for="{{xxxs}}" wx:key="xxxId" wx:for-item="xxx">
<view>"{{xxx.xxxId}}"</view>
<view>"{{xxx.yyy}}"</view>
<view>"{{xxx.zzz}}"</view>
</block>
</view>
xxxPage.ts:
import { storeService, routeActions, routeService, authActions, xxxActions } from '@litewash/ui-core';
import {connect} from 'wechat-weapp-redux';
Page(connect(state => ({account:state.account, routes:state.routes, xxxs:state.xxxs})) ({
data: {
},
onClick: function() {
//登录认证
storeService.dispatch(authActions.loginDB({username:'a', password:'b'}), ()=>{
//服务请求
storeService.dispatch(xxxActions.do({param1:'a'}), () => {
//页面导航
storeService.dispatch(routeActions.goto({path:'/pages/page1/Page1'}));
});
});
},
}));