【发布时间】:2015-11-20 18:10:33
【问题描述】:
我在这里重新创建了一个 h2 元素:
<link rel="import" href="../../js/lib/polymer/polymer.html">
<dom-module id="x-custom">
<style>
h2 { color: green; }
</style>
<template>
<div id="content">
<h2>TEST</h2>
</div>
</template>
<script>
(function() {
Polymer({
is: 'x-custom',
ready: function() {
this.$.content.innerHTML = '<h2>TEST 2</h2>';
this.updateStyles();
}
});
})();
</script>
</dom-module>
如果我跳过准备好的功能,“TEST”是绿色的,但不是“TEST 2”。想updateStyles() 可以解决这个问题,但没有。任何想法为什么这不起作用? (聚合物 1.0,铬 44)
【问题讨论】:
标签: css polymer-1.0 shadow-dom