[Vuejs]-Is there a way to convert from a component with inputs to raw html?

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.

Leave a comment