加强、优化富文本(rich-text)组件,调用方便,可配置,大幅度优化富文本组件;
div、h1-6、p、b、strong、code、img、blockquote、ul、li、table、td、自动转换的标签 : pre (用于展示代码类内容)
<template>
<gracePage :customHeader="false">
<view slot="gBody" class="grace-body">
<view class="grace-margin-top">
<rich-text type="text" :nodes="demoHtml"></rich-text>
</view>
</view>
</gracePage>
</template>
<script>
import gracePage from "../../graceUI/components/gracePage.vue";
var graceRichText = require("../../graceUI/jsTools/richText.js");
export default {
data(){
return {demoHtml : ''}
},
components:{
gracePage
},
onLoad : function(){
uni.request({
url:'http://grace.hcoder.net/richTextDemo.php',
success:(res)=>{
// 强化 richText
this.demoHtml = graceRichText.format(res.data);
}
});
}
}
</script>
<style>
</style>