zgatrying / mobx-wxapp-example

在微信小程序中使用mobx

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mobx-wxapp-example

在微信小程序中使用mobxmobx-wxapp简单的提供了一个observer函数,用法如例所示。

用法

js:

import userStore from '../stores/user';
import otherStore from '../stores/other';
import {observer} from "../utils/mobx-wxapp";

Page(observer({userStore, otherStore})({
    onLoad() {
    },
    //...
}));

wxml:

<view>name:{{userStore.name}}...</view>

License

MIT licensed.

About

在微信小程序中使用mobx


Languages

Language:JavaScript 100.0%