Dynamic component with pascalcase not working correctly
Version
3.0.9
Reproduction link
https://codesandbox.io/s/summer-sun-dymh9?file=/src/App.vue
Steps to reproduce
<template>
<button @click="hello = !hello">Toggle</button>
<Component :is="component" /> // not work. If it change to <component />, it works
</template>
<script>
import HelloWorld from "./components/HelloWorld.vue";
import ByeWorld from "./components/ByeWorld.vue";
export default {
name: "App",
components: {
HelloWorld,
ByeWorld,
},
data() {
return {
hello: true,
};
},
computed: {
component() {
return this.hello ? "HelloWorld" : "ByeWorld";
},
},
};
</script>
What is expected?
What is actually happening?
no error in console. and show nothing
interesting 🤔
at the following comment, only lowercase is allowed. https://github.com/vuejs/vue-next/issues/1167#issuecomment-626968071
But, PR https://github.com/vuejs/vue-next/pull/3508 make <Component>
allowed.. 🤔
That should be a misunderstanding, because Vue2 allows a capitalized version, so we should keep that behavior.
That should be a misunderstanding, because Vue2 allows a capitalized version, so we should keep that behavior.
Ah, I understood, Vue3 allow <Component>
case as well.