Skip to content

Commit c8fac87

Browse files
berzinaokie
authored andcommitted
add important clarification to <template> (#1283)
`<template>` is used as a wrapper for [conditional rendering](https://v3.vuejs.org/guide/conditional.html#conditional-groups-with-v-if-on-template) of multiple elements, and as such **is** allowed to exist multiple times within a component, even a single-file one, but the top-level `<template>` tag must be only one.
1 parent 0579cfd commit c8fac87

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/api/sfc-spec.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default {
3434

3535
### `<template>`
3636

37-
- Each `*.vue` file can contain at most one `<template>` block at a time.
37+
- Each `*.vue` file can contain at most one top-level `<template>` block at a time.
3838

3939
- Contents will be extracted and passed on to `@vue/compiler-dom`, pre-compiled into JavaScript render functions, and attached to the exported component as its `render` option.
4040

0 commit comments

Comments
 (0)