Nuxt - [@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.

报错原因

在 Vue 中,我们经常使用 >>>/deep/ 进行样式穿透,修改组件库的样式。

如下图所示,详细报错:

在这里插入图片描述
这是由于您使用了以下覆盖样式的语法:

在这里插入图片描述
在这里插入图片描述

解决方案

使用目前最新的覆盖语法即可。

例如,覆盖 vant 组件库的 .van-dialog 类:

:deep(.van-dialog){
    
    
    padding: 0 0;
    background: none!important;
}

在这里插入图片描述

写在后面

该语法支持在 <style scoped> 中使用。

SEO

vue.js nuxt.js [@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead. 报错怎么解决方案弃用‘the >>> and /deep/ combinators have been depr…vue 中使用/deep/深度选择器,谷歌浏览器报出警告

猜你喜欢

转载自blog.csdn.net/weixin_44198965/article/details/126865065