Skip to content

Commit

Permalink
vue
Browse files Browse the repository at this point in the history
  • Loading branch information
realgeoffrey committed Jan 1, 2024
1 parent e225a86 commit a3dcbbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion 网站前端/Vue.js学习笔记/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,10 @@

7. `template`(字符串):组件的字符串模板

>todo: 怎么用??
>限制:只在[完整版](https://v2.cn.vuejs.org/v2/guide/installation.html#对不同构建版本的解释)时可用(需要编译器;运行时-runtime版本没有编译器)。

1. 直接字符串作为模板,e.g. `template: '<div>{{ msg }}</div'`。
2. 若字符串包含`#id名`,则去取`<script type="x-template" id="id名">`的innerHTML作为模板。
8. `render`(`(createElement: () => VNode) => VNode`):字符串模板的代替方案
若组件是一个函数组件,则渲染函数还会接收一个额外的context参数,为没有实例的函数组件提供上下文信息。
Expand Down

0 comments on commit a3dcbbd

Please sign in to comment.