为什么设置混合宏 stylus 的border-1px 函数 引入到到 App.vue下 页面渲染无反应

来源:15-6 1像素border实现

Saber专属

2017-07-25

App.vue下
<style lang="stylus" rel="stylesheet/stylus" type="text/stylus">
 // 混合宏样式引入
 @import "./common/stylus/mxin.styl"

 .tab
 display: flex
 width: 100%
    height: 40px
 line-height: 40px
 // border-bottom: 1px solid rgba(7,17,27,0.1)
 border-1px(rgba(7, 17, 27, 0.1))
    flex-direction row
 .tab-item
 flex: 1
 text-align center
 & > a
 display: block
 text-decoration: none
 font-size: 14px
 color: rgb(77, 85, 95)
        &.active
 color: rgb(240, 20, 20)
</style>
mixin.styl文件
/**
 混合宏 ,sass语法设置函数
 */

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


写回答

2回答

Saber专属

提问者

2017-07-26

我一定要总结一番!

  1. 伪类没设宽度 

  2. dpi的画可能导致太小 看不清,这个基本上不可能

  3. 最后重点是stylus中注释导致样式失效(这个是一个忽视的地方)

2
2
慕前端9233562
那个注释导致编译问题,找解决方法找好久,突然看到这个解答,感谢!!!
2018-08-01
共2条回复

ustbhuangyi

2017-07-26

你的 stylus 缩进有问题吧

0
2
Saber专属
老师,可以了,群友帮忙,终于解决了。
2017-07-26
共2条回复

Vue.js2.5+cube-ui重构饿了么App(经典再升级)

掌握Vue1.0到2.0再到2.5最全版本应用与迭代,打造极致流畅的WebApp

9868 学习 · 4162 问题

查看课程