I was doing some experiments with Vue. When I add the same component multiple times with different properties it renders only once. I investigated and come to know that it didn't render the component after adding the first self-closing style component.
I don't know what is going on here.
FYI- I am using Vue 3. but I think it is also not working with Vue 2.
here is the code.
let Counter = {
props: {
count: {
type: Number,
required: true
}
},
template: `
<span>{{ count }}</span>
`
}
const app = Vue.createApp({
components: {
'counter': Counter
},
});
const vm = app.mount("#app");
<script src="https://unpkg.com/vue@next"></script>
<div id="app">
<counter :count="1"></counter>
<br />
<counter :count="2" />
<br />
<counter :count="3"></counter>
</div>
In this code, the app will only render 1
and 2
but as soon it reached the first self-closing component then the next component will never be rendered. i.e 3
is not render.