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