I am using a grid in a component. I pass the number of columns to the component through props. I use this component twice in the same page. In one component I use 3 columns and in the other I use 4. With 3 columns it works as it should, with 4 it ignores the number of columns and displays my 4 columns in one.
<template>
<div>
<Component columns="3">
<Column1>
<Column2>
<Column3>
</Component>
<Component columns="4">
<Column1>
<Column2>
<Column3>
<Column4>
</Component>
</div>
</template>
This is the component
<template>
<div class="bg-grey-light" :class="classes">
<slot></slot>
</div>
</template>
<script>
export default {
name: "Component",
props: {
columns: {
type: String,
},
},
computed: {
classes() {
return "grid grid-cols-" + this.columns;
},
},
};
</script>
This is quite a strange behaviour. What's wrong ?? How can I have 4 columns in the second component ?