Subscribe on changes!

Get rid of redundant <template> tag when define a component

avatar
Nov 25th 2022

What problem does this feature solve?

As an improvement, make <template> tag optional or remove it completely when defining html template for a component.

Current way to define a HelloWorld.vue:

<template>
  <h1>Hello World!</h1>
</template>

What does the proposed API look like?

I suggest to improve it to:

<h1>Hello World!</h1>

Much more concise, just one-liner instead of having 2 more lines and better readability overall.

avatar
Nov 25th 2022

Agree, this is the thing that is awesome on svelte. Just remove the template tag.

avatar
Dec 7th 2022

Another thing is, maybe bringing back the native behavior of <template> HTML element which gives flexibility when to render certain things.

avatar
Sep 20th 2023

Let's track this feature request in the RFC discussion instead https://github.com/vuejs/rfcs/discussions/525