欢迎来到DIVCSS5查找CSS资料与学习DIV CSS布局技术!
Vue—样式穿透/deep/ >>> ::v-deep deep()四者的区别
 
1./deep/#
在vue3.0之前可使用,例如(复写样式前加/deep/),vue3.0及后使用就会报错
 
& /deep/ .el-input {
    width: 60px;
}
2. ::v-deep#
在vue3.0及后使用,替代/deep/
 
&::v-deep .el-input {
    width: 60px;
}
3. >>>#
只作用于css,对于less和scss不起作用,如果是less和scss的话需要用到/deep/或::v-deep
 
4. deep()#
使用场景尚需补充
 
&:deep(.el-input) {
    width: 60px;
}

如需转载,请注明文章出处和来源网址:http://www.divcss5.com/html/h64655.shtml