网页
综合
更新时间 2026-11-13 16:59:08
Options: Rendering | Vue.js
自动蜘蛛
vuejs.org
正文约 2223 字
Reactivity: Utilities
Reactivity: Advanced
Dependency Injection
Options: Composition
Syntax Specification
Server-Side Rendering
TypeScript Utility Types
A string template for the component.
A template provided via the template option will be compiled on-the-fly at runtime. It is only supported when using a build of Vue that includes the template compiler. The template compiler is NOT included in Vue builds that have the word runtime in their names, e.g. vue.runtime.esm-bundler.js. Consult the dist file guide for more details about the different builds.
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.
If the render option is also present in the same component, template will be ignored.
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.
Only use template sources that you can trust. Do not use user-provided content as your template. See Security Guide for more details.
A function that programmatically returns the virtual DOM tree of the component.
render is an alternative to string templates that allows you to leverage the full programmatic power of JavaScript to declare the render output of the component.
Pre-compiled templates, for example those in Single-File Components, are compiled into the render option at build time. If both render and template are present in a component, render will take higher priority.
Configure runtime compiler options for the component's template.
This config option is only respected when using the full build (i.e. the standalone vue.js that can compile templates in the browser). It supports the same options as the app-level app.config.compilerOptions, and has higher priority for the current component.
See also app.config.compilerOptions
An option to assist with type inference when using slots programmatically in render functions.
This option's runtime value is not used. The actual types should be declared via type casting using the SlotsType type helper:
Edit this page on GitHub
本页为82搜索生成的网页快照,内容来自站内索引;演示数据的原文链接仅作示例。