0.1.9 • Published 6 years ago

@nosea/mobx v0.1.9

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

@nosea/mobx

Mobx@4 binding for @nosea/core.

小程序框架 @nosea/coremobx binding.

使用方法

In app entry:

  import { NoseaApp } from '@nosea/core'
  import NoseaMobxBindPlugin from '@nosea/mobx'

  class MyApp extends NoseaApp {
    static pageData = {}
    static plugins = [
      new NoseaMobxBindPlugin()
    ]

    onLaunch () {
      console.log('app onLaunch')
    }
  }

  export default ThinkieApp

In page entry:

  import { NoseaPage } from '@nosea/core'
  import { observable, computed } from 'mobx'

  class TabPagesView extends NoseaPage {
    static data = {}
    static methods = {}

    @observable foo = {
      bar: 114514
    }
    @computed get bar () {
      return [foo.bar, 1919810]
    }

    onLoad (res) {
      console.log('page onLoad', res, this)
    }

    onShow (res) {
      console.log('page onShow', res, this)
    }
  }

  export default TabPagesView

In page template:

  <view>{{ bar[0] }}</view>
  <view>{{ bar[1] }}</view>

其他

使用 MIT 协议开源。

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago