File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -563,7 +563,11 @@ type: api
563
563
564
564
<p class =" tip " > 提供的元素只能作为挂载点。不同于 Vue 1.x,所有的挂载元素会被 Vue 生成的 DOM 替换。因此不推荐挂载root实例到 `<html >` 或者 `<body >` 上。</p >
565
565
566
- - ** 参考:** [ 生命周期图示] ( ../guide/instance.html#生命周期图示 )
566
+ <p class =" tip " >如果 `render` 函数和 `template` 属性都不存在,挂载 DOM 元素的 HTML 会被提取出来用作模板,此时,必须使用 Runtime + Compiler 构建的 Vue 库。</p >
567
+
568
+ - ** 参考:**
569
+ - [ 生命周期图示] ( ../guide/instance.html#生命周期图示 )
570
+ - [ 独立构建-vs-运行时构建] ( ../guide/installation.html#独立构建-vs-运行时构建 )
567
571
568
572
### template
569
573
@@ -577,6 +581,8 @@ type: api
577
581
578
582
<p class =" tip " >出于安全考虑,您应该只使用您信任的 Vue 模板。避免使用其他人生成的内容作为您的模板。</p >
579
583
584
+ <p class =" tip " >如果 Vue 选项中包含 render 函数,template 选项将被忽略。</p >
585
+
580
586
- ** 参考:**
581
587
- [ 生命周期图示] ( ../guide/instance.html#生命周期图示 )
582
588
- [ 内容分发] ( ../guide/components.html#使用-Slot-分发内容 )
@@ -591,6 +597,8 @@ type: api
591
597
592
598
如果组件是一个函数组件,Render 函数还会接收一个额外的 ` context ` 参数,为没有实例的函数组件提供上下文信息。
593
599
600
+ <p class =" tip " >Vue 选项中的 `render` 函数若存在,则 Vue 构造函数不会从 `template` 选项或通过 `el` 选项指定的挂载元素中提取出的 HTML 模板编译 render 函数。</p >
601
+
594
602
- ** 参考:**
595
603
- [ Render 函数] ( ../guide/render-function.html )
596
604
You can’t perform that action at this time.
0 commit comments