refactor: componentize responsive grid
This commit is contained in:
parent
f0fb7a5981
commit
7c0a3b6375
2 changed files with 28 additions and 31 deletions
18
components/ResponsiveGrid.vue
Normal file
18
components/ResponsiveGrid.vue
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<template>
|
||||
<div
|
||||
class="grid gap-4"
|
||||
:class="`grid-cols-${min} md:grid-cols-${mid} 2xl:grid-cols-${max}`"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
min: { type: [Number, String], default: 1 },
|
||||
mid: { type: [Number, String], default: 2 },
|
||||
max: { type: [Number, String], default: 3 },
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in a new issue