草庐IT

internalState

全部标签

javascript - polymer 中的私有(private)非静态变量?

如何在polymer中拥有私有(private)非静态变量?在:Polymer('component-one',{internalState=1,ready(){this.anotherInternalState=1;}/*morevariablesandfunctions*/});internalState和anotherInernalState都暴露给外部(例如,可以通过类似的方式访问:document.querySelector('component-one').internalState(当从外部更改internalState会使组件不稳定时,这可能是不可取的。)其中:(fun