and /deep/ combinators have been deprecated. Use :deep() instead.
and /deep/ combinators have been deprecated. Use :deep() instead.
·
今天在做项目的时候发现有这么一条警告
[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
是因为在 vue3 中已经弃用了 /deep/ (深度选择器)
使用
::deep()
错误使用方法:
// 之前是这样的写法
.el-aside {
width: 220px;
height: calc(100vh - 10vh);
border-right: 1px solid #e6e6e6;
overflow-x: hidden;
/deep/.el-scrollbar__wrap {
overflow: auto !important;
height: 100%;
}
}
// 报警告:[@vue/compiler-sfc] the >>> and /deep/ combinators have been deprecated. Use :deep() instead.
正确使用方法:
这样写,就不会有警告信息了
.el-aside {
width: 220px;
height: calc(100vh - 10vh);
border-right: 1px solid #e6e6e6;
overflow-x: hidden;
//重点 重点 重点-------------------------------
:deep(.el-scrollbar__wrap) {
overflow: auto !important;
height: 100%;
}
//重点 重点 重点-------------------------------
}
更多推荐
已为社区贡献5条内容
所有评论(0)