How to convert a string into a HTML element in Mithril?

前端 未结 3 630
情歌与酒
情歌与酒 2021-01-19 13:30

Suppose I have a string Text goes here.I need to use this string as a HTML element in my webpage. Any ideas on how to do

3条回答
  •  面向向阳花
    2021-01-19 14:06

    Mithril provides the m.trust method for this. At the place in your view where you want the HTML output, write m.trust( 'Text goes here' ) and you should be sorted.

提交回复
热议问题