I'm trying to avoid Vue from compiling plain HTML-Tags inside root element. Here is a code example:
<body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/3.0.5/vue.global.js"></script>
<script type="application/javascript" src="my_component.js">
<script>const app = Vue.createApp({});</script>
<div id="app">
<my-component></my-component>
...
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
...
<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
...
</div>
<script>app.mount("#app");</script>
</body>
Vue 3 compiles all of the elements (plain HTML-Elements to) within the root elements to search for Vue components, but this can be a load problem if the page is very large and doesn't have that many Vue components.
I was trying to do something like this:
<script>app.config.isCustomElement = tag => tag.startsWith('div') || tag.startsWith('span');</script>
but that doesn't ignors plain HTML-Tags as div and span.
Another option that i tired was:
...
<div id="app">
<my-component></my-component>
...
<div v-pre>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
...
<span>1</span>
<span>2</span>
<span>3</span>
<span>4</span>
...
</div>
</div>
...
This was also not so successful.
Can someone help me with this problem?