uniapp---解析富文本


1.uniapp插件市场下载mp-html。

  链接:mp-html.zip

2.放到components目录下。

3.页面使用。

<template>
    <view class="content">
        <view class="text-area">
            <text class="title">{{title}}</text>
            <mp-html class="title" :content="title" />
        </view>
    </view>
</template>

<script>
    import mpHtml from '@/components/mp-html/mp-html'
    export default {
        components: {
            mpHtml
        },
        data() {
            return {
                title: '<p>Hello,mp-html!</p>'
            }
        }
    }
</script>

<style>
    .content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .title {
        font-size: 36rpx;
        color: #8f8f94;
    }
</style>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM