0👍
First, add a ref
attribute to the line, such as ref='component-z'
If you are inside the <script>
portion of the Vue file, you can access the Vue instance and its references like this:
this.$refs
To access the outer HTML (or rendered/raw HTML) of that component, use
this.$refs["component-z"].$el.outerHTML
Note the “component-z” portion of that JavaScript, which corresponds to that ref
attribute you set.
- [Vuejs]-Tranferring focus and clearing fields based on a barcode reading (VueJS)
- [Vuejs]-How to import extrenal library on mounted hook in Nuxt Js?
Source:stackexchange.com