HTML如何訪問聚合物中的屬性值?
<my-element username="{{params.username}}"></my-element>
元
<dom-module id="my-element">
<style>
:host {
display: block;
}
</style>
<template>
</template>
<script>
(function() {
Polymer({
is: 'my-elemnt',
ready: function(){
// get attribute value
});
})();
</script>
</dom-module>
我可以訪問模板中的屬性,但不知道如何將它使用JavaScript訪問。
您有一個錯字:您的錯字是:>,':my-elemnt', –