s***@163.com
s***@163.com
  • 发布:2019-02-19 10:46
  • 更新:2019-02-19 12:13
  • 阅读:2403

rich-text 使用class 并不能显示class样式

分类:uni-app
<template>  
    <view>  
        <view class="text-color">  
            test view color  
        </view>  
        <rich-text :nodes="nodeString"></rich-text>  
    </view>  
</template>  

<script>  
    export default {  
        data() {  
            return {  
                nodeString: '<div class="text-color">222222</div>'  
            };  
        },  
    }  
</script>  

<style>  
.text-color {  
    color: #008800;  
}  
</style>

那这个要使class样式生效,要怎么写?

2019-02-19 10:46 负责人:无 分享
已邀请:
虫雪浓

虫雪浓 - 热爱生活,热爱编程

直接在 app.vue 写类名试一下。

你的示例在 app 和小程序端是没问题的,h5 可以直接写在 app.vue 下。

该问题目前已经被锁定, 无法添加新回复