Polymer 聚合物结合-为什么链接路径在此示例中不起作用?
我有这个样本:Polymer 聚合物结合-为什么链接路径在此示例中不起作用?,polymer,Polymer,我有这个样本: Polymer({ is: 'testElement', properties: { content: { type: Object, value: null }, contentA: { type: Object, value: "testFoo"
Polymer({
is: 'testElement',
properties: {
content: {
type: Object,
value: null
},
contentA: {
type: Object,
value: "testFoo"
}
},
attached: function () {
this.linkPaths("content", "contentA")
this.set("contentA", "fooTest873");
console.log(this.contentA);
console.log(this.content);
}
});
我现在尝试在内容和contentA之间建立一个函数绑定,这样当contentA被更新时,内容也会被更新。
不幸的是,这在当前的Firefox或Chrome中不起作用。这是链接路径的限制。 它目前只支持链接深度路径 例如,此.linkpath(“contentA.myProp”、“contentB.myProp”) 另请参见github上的此问题:
我不确定这是否会导致您的问题,但您将content和contentA都定义为对象,然后使用字符串值。您是否尝试过将它们定义为字符串或实际使用对象作为值?