0 votes
in VueJS by
What are X Templates?

1 Answer

0 votes
by

Apart from regular templates and inline templates, you can also define templates using a script element with the type text/x-template and then referencing the template by an id.

Let's create a x-template for simple use case as below,

<script type="text/x-template" id="script-template">

  <p>Welcome to X-Template feature</p>

</script>

Now you can define the template using reference id,

Vue.component('x-template-example', {

  template: '#script-template'

})

Related questions

+1 vote
asked Feb 6, 2023 in VueJS by john ganales
0 votes
asked May 2, 2023 in Azure by rahuljain1
...