vue.js - 如何以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 格式获取数据。是“”引起的问题吗?请帮我解决
解决方案
使用v-html
指令从 html 字符串输出真实的 html;说如果content
是从添加的内容vue-editor
:
<span v-html="content"></span>
推荐阅读
- php - 欧拉计划 - 3 | 为什么程序不退出while循环?
- python - Python比较索引是否不同于一个
- c# - 检测datagridview中的空白行
- python - 时间序列数据 mongodb 的存储桶模式与 python pymongo
- snowflake-cloud-data-platform - 在雪花中创建表的 Javascript 程序
- html - Bootstrap 8 网格系统
- excel - 选择 ActiveChart 范围以删除值以下的数据标签
- reactjs - Metarial UI useMediaQuery hooks 两次渲染到 React 组件,你有什么解决方案吗?
- python - 为什么 django 调试工具栏被隐藏?
- python - 如何修复 if 语句