I was looking a bit for Polymer 1.0 elements, and I'm a little curious to figure out the properties.
For example, in paper-drawer-panel.html ,
<dom-module id="paper-drawer-panel" …> … <div id="main" style$="[[_computeDrawerStyle(drawerWidth)]]"> … </div> … </dom-module> <script> Polymer({ is: 'paper-drawer-panel', … _computeDrawerStyle: function(drawerWidth) { return 'width:' + drawerWidth + ';'; }, … </script>
drawerWidth is a paper-drawer-panel property, so why is it so important to explicitly include it in the parameters of the computed property?
Is an
[[_computeDrawerStyle()]] … _computeDrawerStyle: function () { return 'width:' + this.drawerWidth + ';'; }
Is this a bad practice?
source share