Data binding 聚合条件属性

Data binding 聚合条件属性,data-binding,polymer,Data Binding,Polymer,尝试使用定义元素时 仍然在聚合物0.5。 以下是完整的代码: <polymer-element name="hover-button" extends="paper-button" hover?="{{hover}}"> <template> <shadow></shadow> </template> <script> (function(){ Polymer('hover-button',

尝试使用定义元素时

仍然在聚合物0.5。 以下是完整的代码:

<polymer-element name="hover-button" extends="paper-button" hover?="{{hover}}">
<template>
    <shadow></shadow>
</template>

<script>
    (function(){
        Polymer('hover-button', {
            ready: function(){
                this.addEventListener('mouseover', function(){ this.hover = true; }.bind(this));
                this.addEventListener('mouseout', function(){ this.hover = false; }.bind(this));
            },
            activeChanged: function(){ /* foo */ },
            hoverChanged: function(){ /* bar */ }
        });
    })();
</script>
</polymer-element>

(功能(){
聚合物(“悬停按钮”{
就绪:函数(){
this.addEventListener('mouseover',function(){this.hover=true;}.bind(this));
this.addEventListener('mouseout',function(){this.hover=false;}.bind(this));
},
activeChanged:function(){/*foo*/},
hoverChanged:function(){/*bar*/}
});
})();

您不能在
本身上使用数据绑定功能。此外,在
(默认情况下,不是属性的一部分的
属性
被添加到元素的实例中。我怀疑这就是错误产生的原因。

我尝试将
悬停
声明为已发布属性,但错误仍在显示。是否有方法以声明方式执行此操作?
Uncaught InvalidCharacterError: Failed to execute 'setAttribute' on 'Element': 'hover?' is not a valid attribute name.
<polymer-element name="hover-button" extends="paper-button" hover?="{{hover}}">
<template>
    <shadow></shadow>
</template>

<script>
    (function(){
        Polymer('hover-button', {
            ready: function(){
                this.addEventListener('mouseover', function(){ this.hover = true; }.bind(this));
                this.addEventListener('mouseout', function(){ this.hover = false; }.bind(this));
            },
            activeChanged: function(){ /* foo */ },
            hoverChanged: function(){ /* bar */ }
        });
    })();
</script>
</polymer-element>