我有一个奇怪的情况,我不知道要解决。一次性安装标签工作正常。但是,当我以这种方式挂载多个标签副本时:
HTML:
<div class="o-container o-container--medium">
<div class="o-grid o-grid--small-full o-grid--medium-full o-grid--large-full">
<div id="crd-demo-1" class="o-grid__cell">
<rg-card shadow="highest">
My additional <b>content</b> here. <rg-badge style="success">This works!</rg-badge><br /><br />
</rg-card>
</div>
<div id="crd-demo-2" class="o-grid__cell">
<rg-card shadow="high">
My additional <b>content</b> here. Other <b>RiotGear2</b> can also be used inside your card.
<rg-badge style="brand">This works too!</rg-badge><br /><br />
</rg-card>
</div>
</div>
然后按如下方式安装:
var tags = riot.mount("div#crd-demo-1","rg-card", {
// omitted for clarity
});
var tags = riot.mount("div#crd-demo-2","rg-card", {
// omitted for clarity
});
当我看到this.root._innerHTML时,我没有得到标签内容,而是父声明(&lt; rg-card ...&gt; )加上内容。所以它将标签嵌入其中。
我知道我正在安装标签,为每个标签提供不同的选项。关于如何热烈欢迎这一点的任何建议。
答案 0 :(得分:1)