Description
Vue version
3.3.4
Link to minimal reproduction
Steps to reproduce
In the same Vue file (For example: App.vue):
First you import another Vue component as its child component, assuming the name of the child component is StartConversation, like this:
import StartConversation from './StartConversation.vue';
And in template, we can use this component name with kebeb-case "start-conversation" as html tag.
Then, you have a function that has the same name as the child components mentioned aboved, like this:
const startConversation = () => {console.log('Unexpected call the func')};
When you start the Vue project, you can see "Unexpected call the func" printed twice in the console. In the case of Vue SFC playground (link to minimal reproduction provided before), the start-conversation child component will not be rendered.
What is expected?
Vue child component file name should be distinguished from the function name. Notice that the component tag name is kebeb-case, the file name and the registered component name is PascalCase, and the function name is camelCase.
What is actually happening?
The function is incorrectly executed twice due to the component tag name "start-conversation" and "/start-conversation". Although we can use self-closing tag "start-conversation /" in Vue3, the function will also be executed twice.
System Info
No response
Any additional comments?
No response