我有一个对象内的对象,对象的名称可能会改变,我怎么能得到对象的对象内的值,而不是通过名称引用它?获取对象对象内的数据?
Object {medium-editor-1453741508068-0: Object}
medium-editor-1453741508068-0: Object
value: "this is what i want"
这得到上面:
this.mediumEditor.editor.serialize();
我需要这样的东西:
this.mediumEditor.editor.serialize().childObject.value;
这取决于 - 你是如何得到这个物体的?是什么造成的以及你对它有多少控制?你可以决定它是什么类型的对象(并可能创建你自己的'对象'原型,你可以用它来查找特定的数据)。我的思想认为'getter'和'setter',这可能是理想的。我不得不提一下,你的示例对象对于你正在尝试完成的内容还不清楚。 – somethinghere
我无法更改对象,它来自中等编辑器。 – panthro
它会一直被命名为'medium-editor- ...'吗? – somethinghere