使用stylus设置可以复用的样式代码

找到 根目录/src/common/stylus/mixin.styl添加可复用的样式代码

border-1px($color)

  position: relative
  &:after
    display: block
    position: absolute
    left: 0
    bottom: 0
    width: 100%
    border-top: 1px solid $color

    content: ' '


以后在需要的组件里直接就可以用,参数是颜色

border-1px(rgba(7, 17, 27, 0.1))

猜你喜欢

转载自blog.csdn.net/qq_37828633/article/details/79920778