首页 > 解决方案 > 如何以html的形式显示使用vue编辑器添加的内容?

问题描述

我已经使用 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 格式获取数据。是“”引起的问题吗?请帮我解决

标签: vue.jsvue-componentvue-router

解决方案


使用v-html指令从 html 字符串输出真实的 html;说如果content是从添加的内容vue-editor

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

推荐阅读