慕哥0258496
2018-09-06 02:10
var foo = computed(function(){return store.string +"/" + store.number;});
console.log(foo.get());
得到的是
undefined/undefined
这是怎么回事?
我得到的也是 undefined,不知道为什么
import {observable, isArrayLike, computed, action, autorun, when, reaction} from "mobx"; class Store { @observable array = []; @observable obj = {}; @observable map = new Map(); @observable string = 'hello'; @observable number = 20; @observable bool = true; @computed get mixed() { return store.string + ':' + store.number; } } let store = new Store(); var foo = computed(function(){return store.string +"/" + store.number;}); console.log(foo.get());
mobx入门基础教程
18816 学习 · 54 问题
相似问题