Vladimir  Golub
Vladimir Golub

Reputation: 613

How to get html content in component from v-html?

I want to get html content from v-html.

If I use slot, I have this.$slot.

What is analog for v-html?

Upvotes: 0

Views: 855

Answers (1)

tony19
tony19

Reputation: 138216

The v-html directive simply sets the element's innerHTML, which can be accessed through this.$el.innerHTML:

export default {
  mounted() {
    console.log(this.$el.innerHTML)
  }
}

demo

Upvotes: 1

Related Questions