DEV Community

Discussion on: Native Javascript element selector best practice

Collapse
 
jamesthomson profile image
James Thomson

This. 99.9% you shouldn't touch the DOM manually, Vue being data driven is how you should always approach your app. Set the values in data and initialise the plugin with that data.

That said, if you do need to access an element, the simplest "Vue way" to do it is by using $refs