我正在使用mobx-state-tree,并且我想在出现错误而不是AnonymousModel时实际显示商店名称。
例如:
const data = {'123':{'name':'Part 1','size':'20','qty':'50'},'5678' :{'name':'Part 2','size':'15','qty':'60'},'9810' :{'name':'Part 2','size':'15','qty':'120'}};
const condition = ["5678", "9810"];
Object.keys(data).forEach(key => !condition.includes(key) ? delete data[key] : key);
console.log(data);
仍然给我一个类似
的错误.as-console-wrapper { max-height: 100% !important; top: auto; }
但是我想得到
const SignupModel = types
.model({
isUsingFacebook: false,
birthday: '',
timeOfBirth: types.maybeNull(types.string),
placeOfBirth: types.maybeNull(types.string),
gender: types.maybeNull(types.string),
password: '',
})
答案 0 :(得分:2)
只需将所需的名称作为第一个参数传递给'sourcePath' => __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR,
方法,就像这样:
model