How to display html inside template?

删除回忆录丶 提交于 2019-12-02 04:24:53
ebidel

One way to do this is through a *Changed watcher and setting the .innerHTML the node:

<div id="div"></div>

labelChanged: function() {
  this.$.div.innerHTML = this.label;
}

Then, for the <template repeat> case, wrap things up in a custom element that follows the similar pattern: https://stackoverflow.com/a/22208332.

<element inner-h-t-m-l="{{prop}}"></element>

works for Polymer 2. Source: https://github.com/Polymer/TemplateBinding/issues/57

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!