You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install @vue/cli;
Create a project;
In main.js change mount to:
newVue({el: "#app",// because this id exists twicecomponents: { App },template: "<App/>"});
watch app serve fail because #app exists in App.vue and index.html.
What is expected?
App to mount
What is actually happening?
App is failing to mount due to duplicate id
While helping someone implement ant-design package with vue cli I noticed in App.vue its root element is a div with the id of "app".
Then in public/index.html there is also a div with id "app".
The id should be removed from App.vue
The text was updated successfully, but these errors were encountered:
When Vue mount the app, the entire outer HTML of the target element is replaced with the rendered templates & components. Which means in the end there is only one <div id="app">. But this doesn't even matter because mounting isn't done yet when Vue looks for the el target. So whatever you put in the template isn't rendered to the DOM at this stage.
watch app serve fail because #app exists in App.vue and index.html.
Version
3.8.0
Reproduction link
https://codesandbox.io/s/vue-template-p5kdn?fontsize=14
Steps to reproduce
Install @vue/cli;
Create a project;
In main.js change mount to:
watch app serve fail because #app exists in App.vue and index.html.
What is expected?
App to mount
What is actually happening?
App is failing to mount due to duplicate id
While helping someone implement ant-design package with vue cli I noticed in
App.vue
its root element is a div with the id of "app".Then in
public/index.html
there is also a div with id "app".The id should be removed from
App.vue
The text was updated successfully, but these errors were encountered: