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
//An HTML tag name, component options, or function
100
-
//returning one of these. Required.
99
+
//一个 HTML 标签,组件设置,或一个函数
100
+
//必须 Return 上述其中一个
101
101
'div',
102
102
103
103
// {Object}
104
-
//A data object corresponding to the attributes
105
-
//you would use in a template. Optional.
104
+
//一个对应属性的数据对象
105
+
//您可以在 template 中使用.可选项.
106
106
{
107
-
// (see details in the next section below)
107
+
// (下一章,将详细说明相关细节)
108
108
},
109
109
110
110
// {String | Array}
111
-
//Children VNodes. Optional.
111
+
//子节点(VNodes). 可选项.
112
112
[
113
113
createElement('h1', 'hello world'),
114
114
createElement(MyComponent, {
@@ -123,21 +123,22 @@ createElement(
123
123
124
124
### 完整数据对象
125
125
126
-
One thing to note: similar to how `v-bind:class` and `v-bind:style` have special treatment in templates, they have their own top-level fields in VNode data objects.
Since functional components are just functions, they're much cheaper to render. They're also very useful as wrapper components. For example, when you need to:
361
360
362
361
- 程序化地在多个组件中选择一个
363
362
- 在将 children, props, data 传递给子组件之前操作它们。
364
363
365
-
- Programmatically choose one of several other components to delegate to
366
-
- Manipulate children, props, or data before passing them on to a child component
0 commit comments