如何将字符串html代码转换为div?在Nuxt js项目中

时间:2019-05-29 03:01:31

标签: html nuxt.js

如何正确显示一部分html代码?

HTML代码:

<div>{{`<p>_html_data</p>`}}</div>

JavaScript代码:

var _html_data = `<section>
              <h1 style="color: #5e9ca0;">
                You can edit
                <span style="color: #2b2301;">this demo</span> text!
              </h1>
              <h2 style="color: #2e6c80;">How to use the editor:</h2>
              <p>
                Paste your documents in the visual editor on the left or your HTML code in the source editor in the right.
                <br>Edit any of the two areas and see the other changing in real time.&nbsp;
              </p>
            </section>`;

0 个答案:

没有答案