Hoang Vu
Hoang Vu

Reputation: 91

Use Web Components with Vue

I am currently trying reusing Web Components in a Vue Component. The Web Components use template for formatting the output, but when i place it in the Vue Template, it will be removed from the DOM or compiled by Vue. The Point is: Web Components need this template element for working.

Is there anyway to tell Vue to ignore this template element while compiling?

Best wishes

Upvotes: 2

Views: 151

Answers (1)

Stephan-v
Stephan-v

Reputation: 20329

You should be able to tag the element with v-pre which prevents Vue from compiling it.

From the official documentation:

<span v-pre>{{ this will not be compiled }}</span>

Upvotes: 2

Related Questions