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
Copy file name to clipboardExpand all lines: src/guide/render-function.md
+24-24Lines changed: 24 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -166,11 +166,11 @@ h(
166
166
)
167
167
```
168
168
169
-
If there are no props then the children can usually be passed as the second argument. In cases where that would be ambiguous, `null`can be passed as the second argument to keep the children as the third argument.
169
+
props がない場合は、通常 children を第2引数として渡すことができます。それがあいまいな場合は、 `null`を第2引数として渡して、 children を第3引数にしておけます。
170
170
171
171
## 完全な例
172
172
173
-
この知識によって、書き始めたコンポーネントを今では完成させることができます:
173
+
この知識によって、今度は書き始めたコンポーネントを完成させることができます:
174
174
175
175
```js
176
176
const { createApp, h } = Vue
@@ -246,17 +246,17 @@ render() {
246
246
}
247
247
```
248
248
249
-
## Creating Component VNodes
249
+
## コンポーネントの VNodes を作る
250
250
251
-
To create a VNode for a component, the first argument passed to `h`should be the component itself:
A `render`function will normally only need to use `resolveComponent` for components that are [registered globally](/guide/component-registration.html#global-registration). [Local component registration](/guide/component-registration.html#local-registration) can usually be skipped altogether. Consider the following example:
Rather than registering a component by name and then looking it up we can use it directly instead:
286
+
コンポーネントの名前を登録して、それを調べるというよりも、直接使うことができます:
287
287
288
288
```js
289
289
render() {
@@ -319,7 +319,7 @@ render() {
319
319
}
320
320
```
321
321
322
-
In a template it can be useful to use a `<template>`tag to hold a `v-if`or`v-for`directive. When migrating to a `render`function, the `<template>`tag is no longer required and can be discarded.
For component VNodes, we need to pass the children to`h`as an object rather than an array. Each property is used to populate the slot of the same name:
421
+
コンポーネントの VNodes の場合、引数 children を配列ではなくオブジェクトとして`h`に渡す必要があります。各プロパティは、同名のスロットに移植するために使われます:
422
422
423
423
```js
424
424
render() {
@@ -437,23 +437,23 @@ render() {
437
437
}
438
438
```
439
439
440
-
The slots are passed as functions, allowing the child component to control the creation of each slot's contents. Any reactive data should be accessed within the slot function to ensure that it's registered as a dependency of the child component and not the parent. Conversely, calls to `resolveComponent`should be made outside the slot function, otherwise they'll resolve relative to the wrong component:
0 commit comments