深度作用选择器以及::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead警告解决

如果你希望scoped样式中的一个选择器能够作用的更深,可以使用>>>操作符

<style scoped>
.json-editor{
  height: 100%;
  position: relative;
}
.json-editor >>> .CodeMirror {
  height: auto;
  min-height: 300px;
}
.json-editor >>> .CodeMirror-scroll{
  min-height: 300px;
}
.json-editor >>> .cm-s-rubyblue span.cm-string {
  color: #F08047;
}
</style>

但是想Sass之类的预处理器无法正确解析>>>,这种情况你可以使用/deep/或 ::v-deep操作符取而带之,两者都是>>>的别名,同样可以正常操作,一般我们把这种情况运用在更改elelmentui组件自带的样式时使用

  .showRequired {
    /deep/ .el-form-item__label::before {
      content: '*';
      color: #e63232;
      margin-right: 4px;
    }
  }
  .hiddenRequired {
    /deep/ .el-form-item__label::before {
      content: '' !important;
      color: #e63232;
      margin-right: 4px;
    }
  }

vue3.0使用less或者sass预处理器使用::v-deep深度选择器抛出如下警告

[@vue/compiler-sfc] ::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead.

 原因新的vue3.0 单文件规范::v-deep写法已经被废弃了
修改成 如下写法,不要加空格

.xtx-carousel {
  ::v-deep(.carousel-btn.prev) {
    left: 270px;
  }
  ::v-deep(.carousel-indicator) {
    padding-left: 250px;
  }

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值