Duplicate "container element"s
See original GitHub issueVersion
3.2.30
Reproduction link
Steps to reproduce
In Vue 2 when we wrap things in #app
we don’t get 2 container elements.
In Vue 3 though, we do.
Check Vue 2 project: https://codesandbox.io/s/reverent-tdd-4hs4j?file=/src/App.vue Check Vue 3 project: https://stackblitz.com/edit/vitejs-vite-jnq5k4?file=src/App.vue
Vue 2 screenshot:
Vue 3 screenshot:
Notice the 2 container elements with id app
in Vue 3 version
What is expected?
Vue 2 and Vue 3 should both render one container element
What is actually happening?
In Vue 3 2 nested container elements are rendered
I know that in Vue 3 we can have multiple root elements, but I think the container elements functionality should be the same in Vue 3.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How to copy/clone div to corresponding structure in other ...
I try to copy all "copy-this" elements to the same location in the other container. So first ".copy-this" should be duplicated in the...
Read more >aj on Twitter: "@sixhobbits You can duplicate a whole ...
2. is there a way that I'm missing to duplicate an element or container? Seems like it would be really useful to be...
Read more >How to copy or clone an element with vanilla JS
Copying an element # ... First, let's use the querySelector() method to get our #elem1 element. // Get the element var elem =...
Read more >Algorithms to copy, move and remove container elements
Within this article I want to give an overview about the STL algorithms to copy, move and remove container elements.
Read more >Duplicating into other pages - General - Forum | Webflow
I am trying to duplicate one container into different pages so that I don't have to replicate the same work inside a container...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can try mounting to body, if that helps. But likely not a good idea as it will replace the content
I can accept that you can’t understand it but that’s what it is.
The reason is “Fragments”, pretty much. As we can’t guarantee a single root node, replacing the element at mount with several others, whose number also could change over time, could have unintended side-effects in cases where the document in which the app is mounted is controlled by other code, or break styling etc.
The RFC can be found here https://github.com/vuejs/rfcs/blob/master/active-rfcs/0009-global-api-change.md#mounting-behavior-difference-from-2x
Docs: https://vuejs.org/api/application.html#app-mount