<template>
<div>
temp-component
<hr />
<RowComponent :rows="3" />
</div>
</template>
<script>
import RowComponent from "./RowComponent";
export default {
name: "temp-component",
components: {
RowComponent
}
};
</script>
<template>
<div>
Row
<col-component :rows="rows - 1" />
</div>
</template>
<script>
import ColComponent from "./ColComponent";
export default {
name: "RowComponent",
props: {
rows: {
required: true,
type: Number
}
},
components: {
ColComponent
}
};
</script>
<template>
<div>
Col, next rows count: {{ rows }}
<template v-if="rows > 0">
<hr />
<row-component :rows="rows" />
</template>
</div>
</template>
<script>
import RowComponent from "./RowComponent";
export default {
name: "ColComponent",
props: {
rows: {
required: true,
type: Number
}
},
components: {
RowComponent
}
};
</script>
temp-component
------------------------------
Row
Col, next rows count: 2
------------------------------
Row
Col, next rows count: 1
Row
------------------------------
Col, next rows count: 0
<meta charset="utf-8">