Subscribe on changes!

Mount selector only selects first node it comes across and ignores the rest.

avatar
Mar 4th 2022

Version

3.2.31

Reproduction link

stackblitz.com

Steps to reproduce

Use "Vue.createApp(app).mount(".app")" or any other filter instead of a 'id' filter with '#'. Vue will only mount on to the first node that matches the filter.

What is expected?

That the data gets mounted on all matches of the filter.

What is actually happening?

The data only get mounted on the first match.


I found it due to curiosity. I thought it would be pretty useful in certain scenarios.

avatar
Mar 4th 2022

This is expected. Note you can directly pass an html element to mount so you can use a document.querySelectorAll() and loop through the elements to call mount multiple times.