2017-04-03 197 views
0
的getComputedStyle在

我們polymer1.0組成部分,我們有這樣的:聚合物2.0異步和

attached: function() 
{ 
    var something=this.getComputedStyleValue("--flxs-" + prop) 
    this.async(function() 
    { 
     // do some work here. 
    }); 
} 

在2.0中,既沒有定義this.getComputedStyleValue this.async。

任何想法有什麼選擇?

回答

1

Polymer.Async好像是this.async的替代品。

對於getComputedStyleValue你可以嘗試StyleGather,但我懷疑它會起作用。

否則,LegacyMixin包含所有的舊方法。

+0

單獨一個'Polymer.Async'不起作用。需要添加更多名稱空間。 [API參考](https://www.polymer-project.org/2.0/docs/api/namespaces/Polymer.Async) –