【发布时间】:2020-07-11 19:56:42
【问题描述】:
我正在尝试渲染一些来自 api 的 html。 v-html 标签将<p> 标签输出到页面上,而不是将它们视为html。
这是我正在渲染的数据:
Bio:"<p>Throughout his PhD and post-doctoral research, Dr David focussed on transdermal medical technology. While presenting his research at a skincare conference, he had his "light-bulb moment" realising the expertise he had developed could be reapplied to solve some of the major challenges facing the global cosmetic skincare industry. </p>"
这是带有 v-html 的 html
<div v-html="decodeURIComponent(teamMember.Bio)"></div>
我也试过
<div v-html="teamMember.Bio"></div>
和
<div v-html="decodeURI(teamMember.Bio)"></div>
但它们都在页面上显示段落标签而不是呈现。
【问题讨论】:
标签: html string vue.js urldecode