You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Template declaration and render function priorities (#796)
* Template declaration and render function priorities.
* Template declaration and render function priorities moved to the api document
* Minor revise
* Add link to builds of Vue
* Move link to see also section
Copy file name to clipboardExpand all lines: src/v2/api/index.md
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -609,7 +609,11 @@ if (version === 2) {
609
609
610
610
<pclass="tip">The provided element merely serves as a mounting point. Unlike in Vue 1.x, the mounted element will be replaced with Vue-generated DOM in all cases. It is therefore not recommended to mount the root instance to `<html>` or `<body>`.</p>
<pclass="tip">If neither `render` function nor `template` option is present, the in-DOM HTML of the mounting DOM element will be extracted as the template. In this case, Runtime + Compiler build of Vue should be used.</p>
-[Runtime + Compiler vs. Runtime-only](../guide/installation.html#Runtime-Compiler-vs-Runtime-only)
613
617
614
618
### template
615
619
@@ -623,6 +627,8 @@ if (version === 2) {
623
627
624
628
<pclass="tip">From a security perspective, you should only use Vue templates that you can trust. Never use user-generated content as your template.</p>
625
629
630
+
<pclass="tip">If render function is present in the Vue option, the template will be ignored.</p>
An alternative to string templates allowing you to leverage the full programmatic power of JavaScript. The render function receives a `createElement` method as it's first argument used to create `VNode`s.
637
643
638
644
If the component is a functional component, the render function also receives an extra argument `context`, which provides access to contextual data since functional components are instance-less.
645
+
646
+
<pclass="tip">The `render` function has priority over the render function compiled from `template` option or in-DOM HTML template of the mounting element which is specified by the `el` option.</p>
0 commit comments