mp-reactive-data
v1.0.6
Published
```shell npm install mp-reactive-data ```
Downloads
9
Readme
npm install mp-reactive-data
Usage 1
// app.js
import { ZApp } from 'mp-reactive-data'
const path = '...'
ZApp({}, [{ url: path, method: 'GET', key: 'configData' }])
// page
import { ZPage } from 'mp-reactive-data'
ZPage({}, ['configData'])
<view style="color: {{configData.color}}">Home {{configData.color}}</view>
Usage 2
// app.js
import { provider } from 'mp-reactive-data'
const path = '...'
App({
onShow() {
provider(this, [{ url: path, method: 'GET', key: 'configData' }])
}
})
// page
import { inject } from 'mp-reactive-data'
Page({
onLoad() {
inject(this, ['configData'])
}
})
<view style="color: {{configData.color}}">Home {{configData.color}}</view>
Other Usage
Can mix and use ZApp, provider, ZPage, and inject