0.0.1 • Published 6 years ago
tiio-store v0.0.1
Tiio 观察者模式插件
安装使用
npm install tiio-observer
import tiio from 'tiio'
import observer from 'tiio-observer'
tiio.plugin(observer)
const App = {
state(){
return {
test:1
}
},
mounted(){
setTimeout(()=>{
this.state.test = 2
},1000)
},
methods:{
test(){
this.state.test++
}
},
render( { id }, { test } ){
return <div id={ id } onclick={ ()=>this.test() }> { test } </div>
}
}
tiio.render(<App id="1"/>, document.body)
License
MIT
0.0.1
6 years ago