@mixin 指令允许定义一个可以在整个样式表中重复使用的样式
@mixin flex-j($type: space-between, $type2: center) {
display: flex;
justify-content: $type;
align-items: $type2;
}
@include 指令可以将混入(mixin)引入到文档中。
.goods-list {
height: 760px;
margin-left: 40px;
@include flex-j(flex-start, center)
}
得到下面css
.goods-list {
height: 760px;
margin-left: 40px;
display: flex;
justify-content: flex-start;
align-items: center;
}