如何以html形式显示使用vue编辑器添加的内容?

时间:2018-11-06 04:01:40

标签: vue.js vue-component vue-router

我已经使用vue-editor添加了数据,并且当我尝试显示时显示为

<p class="ql-align-justify">A total of 51 plant species were recorded in the sampled area (0.16 ha). The average GBH and height recorded were 75.41 cm and 15.59 metres respectively. Average tree density was 330 trees per ha. <em>Tectona grandis, Shorea robusta, Cassia fistula, Ehretia laevis, Mallatus phillipensis </em>and <em>Trewia nudiflora </em>were the dominant tree species in the corridor. The ground cover was dominated by shrubs (64.87 %), herbs (29.93%) and grasses (3.2%). The remaining area was barren ground.</p><p class="ql-align-justify"><br></p><p><br></p>

html标记不起作用。所以我怎么能格式化为html形式。请帮我解决。

我正在以json格式获取数据。是“”引起问题吗?请帮我解决问题

1 个答案:

答案 0 :(得分:1)

使用v-html directive从html字符串输出真实的html;假设content是从vue-editor添加的内容:

<span v-html="content"></span>