@litewash/wash-ui-core
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

外部调用示例

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'}));
            }); 
        });
    },
}));   

Readme

Keywords

none

Package Sidebar

Install

npm i @litewash/wash-ui-core

Weekly Downloads

0

Version

0.0.1

License

none

Unpacked Size

13.2 kB

Total Files

22

Last publish

Collaborators

  • xuming314