4👍
Ideally, you don’t ever manipulate the DOM with VueJS. Your component data should drive the DOM, using the data to calculate which classes are on an element or which elements are visible. But I would say the Vue equivalent of your question would be refs: https://v2.vuejs.org/v2/guide/components.html#Child-Component-Refs
You can put a ref on an element and reference it in js:
<div id="parent">
<user-profile ref="profile"></user-profile>
<table ref="table"></table>
</div>
var parent = new Vue({ el: '#parent' })
var child = parent.$refs.profile
var table = parent.$refs.table
👤Jeff
- [Vuejs]-Getting an error when using event bus to communicate data?
- [Vuejs]-Dynamically create, animate and then remove multiple HTML elements in a Vue2 project
Source:stackexchange.com