Polymer 2.0 异步和 getComputedStyle

Polymer 2.0 async and getComputedStyle

在我们的 polymer1.0 组件中,我们有这个:

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

在2.0中,this.getComputedStyleValuethis.async都没有定义。

知道替代方案是什么吗?

Polymer.Async 似乎是 this.async.

的替代品

对于 getComputedStyleValue,您可以尝试 StyleGather,但我怀疑它是否有效。

否则,LegacyMixin包含所有旧方法。