less栅格
<template> <div class="row"> <div class="col-18">1</div> <div class="col-24">2</div> <div class="col-6">3</div> <div class="col-6">4</div> <div class="col-6">5</div> <div class="col-6">6</div> </div> </template> <script> export default {} </script> <style lang="less" scoped> .row{ width: 1500px; display: flex; flex-wrap: wrap; border: 1px solid blue; box-sizing: border-box; div{ box-sizing: border-box; border: 1px solid red; } .loop(@i) when (@i<=24){ .col-@{i}{ width:(1 / 24 * @i *100) * 1%; } .loop(@i + 1); } .loop(1); } </style>
本文来自博客园,作者:zjxgdq,转载请注明原文链接:https://www.cnblogs.com/zjxzhj/p/16066122.html