Skip to content

Commit 01fec59

Browse files
committed
Update the API entry for the template option
1 parent 138acd5 commit 01fec59

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/api/options-rendering.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## template
44

5-
A string template for the component instance.
5+
A string template for the component.
66

77
- **Type**
88

@@ -14,13 +14,13 @@ A string template for the component instance.
1414

1515
- **Details**
1616

17-
Template provided via the `template` option will be compiled on-the-fly, therefore it is only supported when using the full build (i.e. the standalone `vue.js` that can compile templates in the browser).
18-
19-
The template will **replace** the `innerHTML` of mounted element. Any existing markup inside the mounted element will be ignored.
17+
A template provided via the `template` option will be compiled on-the-fly at runtime. It is only supported when using a full build of Vue that includes the template compiler. The builds that include the template compiler have the word `runtime` in their names, e.g. `vue.runtime.esm-bundler.js`. Consult the [dist file guide](https://github.com/vuejs/core/tree/main/packages/vue#which-dist-file-to-use) for more details about the different builds.
2018

2119
If the string starts with `#` it will be used as a `querySelector` and use the selected element's `innerHTML` as the template string. This allows the source template to be authored using native `<template>` elements.
2220

23-
If the `render` is also present in the same component, `template` will be ignored.
21+
If the `render` option is also present in the same component, `template` will be ignored.
22+
23+
If the root component of your application doesn't have a `template` or `render` option specified, Vue will try to use the `innerHTML` of the mounted element as the template instead.
2424

2525
:::warning Security Note
2626
Only use template sources that you can trust. Do not use user-provided content as your template. See [Security Guide](/guide/best-practices/security.html#rule-no-1-never-use-non-trusted-templates) for more details.

0 commit comments

Comments
 (0)