How to display html inside template?

前端 未结 2 1356
广开言路
广开言路 2021-01-24 13:02

I have polymer-element:

example

By default templates is not allowed to insert html.

This sample is not working, because it\'s not allowed to insert

2条回答
  •  滥情空心
    2021-01-24 13:31

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

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

    Then, for the