0👍
There is no guarantee that after $nextTick you will see DOM element immediately.
<div id="meet"></div>
<button @click="onTest">test</button>
...
methods: {
onTest () {
let node=document.querySelector("#meet");
console.log('meet here',node)
},
After you clicked test
you’ll see in a console:
"meet here" "<div id='meet'></div>"
You can try to extract this div with an unique id into a separate component and inside it you can use mounted
hook to know that it exists in DOM
- [Vuejs]-Leaflet multiple markers json
- [Vuejs]-How to create data binding with array input ( multiple input) on vue
0👍
Of course, according to vuetify docs, you may add eager prop to v-tab-item component, and that’s it, but…possibly you are doing something wrong.
It’s not a good idea to always add this prop because you are losing one of the vuetify 2.X advantages – lazy loading. This may lead to big performance problems if there are many elements on the tab.
Maybe it would be better if you will work directly with reactive variables (like variables in v-model directive), not DOM objects.
- [Vuejs]-Vuejs how can I use Google Analytic,Facebook Pixel dynamically
- [Vuejs]-VueJs how to remove global error handler for testing with vue-test-utils
Source:stackexchange.com