为官方提供的 <rich-text></rich-text> 组件提供渐进式支持,并支持官方本身不支持的下划线 HTML 标签(即 <u></u>)和符合 ISO 8859 的实体符号。
此组件依赖 wepy 1.7.0+。
安装:
npm install @skit/wepy-com-richtext --save
引入组件:
<template>
<ui-richtext :content.sync="html" :decode.sync="true" />
</template>
<script>
import wepy from 'wepy';
import UIRichText from '@skit/wepy-com-richtext';
export default class DemoPage extends wepy.page {
components = {
'ui-richtext': UIRichText
};
}
</script>
参数项 | 说明 | 类型 | 是否必填 | 默认值 |
---|---|---|---|---|
content | HTML 源代码片段 | String | 是 | |
decode | 是否按照富文本方式显示 | Boolean | 否 | false |
无