使用伪元素
[class*='van-hairline']::after { content: ' '; position: absolute; box-sizing: border-box; pointer-events: none; top: -50%; right: -50%; bottom: -50%; left: -50%; border: 0 solid #ebedf0; transform: scale(0.5);}.van-hairline,.van-hairline--top,.van-hairline--left,.van-hairline--right,.van-hairline--bottom,.van-hairline--surround,.van-hairline--top-bottom { position: relative;}
上边框
.van-hairline--top::after { border-top-width: 1px;}
下边框
.van-hairline--bottom::after { border-bottom-width: 1px;}
左边框
.van-hairline--left::after { border-left-width: 1px;}
右边框
.van-hairline--right::after { border-right-width: 1px;}
上下边框
.van-hairline--top-bottom::after,.van-hairline-unset--top-bottom::after { border-width: 1px 0;}
全边框
.van-hairline--surround::after { border-width: 1px;}