vue仿饿了么项目总结1

stylus mixin只可以为样式提供函数的功能
border-1px($color)
    position: relative
    &:after
        display: block
        position: absolute
        left: 0
        bottom: 0
        width: 100%
        border-top: 1px solid $color
        content: ' '

@media(-webkit-min-device-pixel-ratio: 1.5), (min-device-pixel-ratio:1.5)
    .border-1px
        &::after
            -webkit-transform: scaleY(0.7)
            transform: scaleY(0.7)

@media(-webkit-min-device-pixel-ratio: 2), (min-device-pixel-ratio: 2)
    .border-1px
        &::after
            -webkit-transform: scaleY(0.5)
            transform: scaleY(0.5)        
例如实现1像素的边框
.food
	position :fixed
	width: 100%
	top: 0
	left: 0
	bottom: 48px
	background :#fff
	z-index :30
	transform: translate3d(0, 0, 0)
  &.move-enter-active,&.move-leave-active
      transition:all 0.2s linear
    &.move-enter,&.move-leave-active
      transform:translate3d(100%,0,0)

转自链接:https://www.jianshu.com/p/256abebd4b12,有改动。

Table of Contents