UNPKG

any-grid-layout

Version:

This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

16 lines (12 loc) 403 B
/** 生成 网格布局grid-templates-areas 属性的模板矩阵值 */ export const genGridAreasLayout = (count,colum)=>{ let areasString = '' let prefix = 'a' for (let i = 0; i < count; i++) { if (i % colum === 0 && i !== 0){ areasString = areasString + `' '` } areasString = areasString + ` ${prefix + i} ` } return `'${areasString}'` }