解决:::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead 的警告问题

1、问题描述:

其一、报错为:

::v-deep usage as a combinator has been deprecated. Use :deep(<inner-selector>) instead

中文为:

::v-deep 作为组合器的用法已被弃用。 使用 :deep(<inner-selector>) 代替

其二、问题描述为:

vue3 项目中,用的是 scss 语言,而在使用穿透语法时,报了警告而非报错,但看着有警告就想来解决这个警告问题;

其三、警告面显示为:

在这里插入图片描述

2、问题分析:

根据中文的显示信息可以知道,本警告的主要问题在于 ::v-deep 作为组合器的用法废弃,要使用 :deep(<inner-selector>) 语法来代替;

3、问题解决:

其一、原来代码:

// 表格表头的背景色;
  ::v-deep .el-table th {
    
    
    background-color: #e6f1f9;
  }

其二、修改后代码:

// 表格表头的背景色;
  ::v-deep(.el-table th) {
    
    
    background-color: #e6f1f9;
  }

其三、此时该警告就解决了;

4、小结:

其一、哪里有不对或不合适的地方,还请大佬们多多指点和交流!
其二、若有转发或引用本文章内容,请注明本博客地址 https://blog.csdn.net/weixin_43405300,创作不易,且行且珍惜!
其三、有兴趣的话,可以多多关注这个专栏(Vue(Vue2+Vue3)面试必备专栏):https://blog.csdn.net/weixin_43405300/category_11525646.html?spm=1001.2014.3001.5482

猜你喜欢

转载自blog.csdn.net/weixin_43405300/article/details/132099608