美文网首页
vue中v-html中标签添加CSS样式

vue中v-html中标签添加CSS样式

作者: 浪浪山小妖_ | 来源:发表于2019-06-11 16:34 被阅读0次

1.通过/deep/使得在使用scoped属性的情况下,穿透scoped,修改其他组件的值

<style lang="less" scoped>
.box{
    /deep/ .info-box {
      color:gray
    }
}
</style>

2.通过>>>使得在使用scoped属性的情况下,穿透scoped,修改其他组件的值

<style lang="less" scoped>
.box{
    >>> .info-box {
      color:gray
    }
}
</style>

若不生效,选其一

--by Affandi ⊙▽⊙

相关文章

网友评论

      本文标题:vue中v-html中标签添加CSS样式

      本文链接:https://www.haomeiwen.com/subject/cjwqfctx.html