- 一个 react 小组件
- 渲染带有 html 标签的富文本、转义字符等,使其在页面正常展示
- 使用简单、方便
Property | Type | Default | Description |
---|---|---|---|
type | string | html 标签,如:'span'、'div'等 | |
html | String | 需要渲染的内容 |
npm i html-dish -S
import React from "react";
import HtmlDish from "html-dish";
function Dish() {
return (
<HtmlDish type="div" html={`<span style="color: red">html-dish</span>`} />
);
}