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
In 3.x, `h`is now globally imported instead of being automatically passed as an argument.
37
+
3.x では、 `h`は自動的に引数に渡されるのではなくグローバルにインポートされます。
38
38
39
39
```js
40
-
// Vue 3 Render Function Example
40
+
// Vue 3 の Render 関数の例
41
41
import { h } from'vue'
42
42
43
43
exportdefault {
@@ -47,24 +47,24 @@ export default {
47
47
}
48
48
```
49
49
50
-
## Render Function Signature Change
50
+
## Render 関数のシグネチャの変更
51
51
52
-
### 2.x Syntax
52
+
### 2.x での構文
53
53
54
-
In 2.x, the`render`function automatically received arguments such as `h`.
54
+
2.x では、`render`関数は自動的に `h` として引数を受け取っていました。
55
55
56
56
```js
57
-
// Vue 2 Render Function Example
57
+
// Vue 2 の Render 関数の例
58
58
exportdefault {
59
59
render(h) {
60
60
returnh('div')
61
61
}
62
62
}
63
63
```
64
64
65
-
### 3.x Syntax
65
+
### 3.x での構文
66
66
67
-
In 3.x, since the `render`function no longer receives any arguments, it will primarily be used inside of the `setup()`function. This has the added benefit of gaining access to reactive state and functions declared in scope, as well as the arguments passed to `setup()`.
@@ -128,16 +129,16 @@ In 3.x, the entire VNode props structure is flattened. Using the example from ab
128
129
}
129
130
```
130
131
131
-
## Migration Strategy
132
+
## 移行の戦略
132
133
133
-
### Library Authors
134
+
### ライブラリの著者
134
135
135
-
`h`being globally imported means that any library that contains Vue components will include `import { h } from 'vue'`somewhere. As a result, this creates a bit of overhead since it requires library authors to properly configure the externalization of Vue in their build setup:
136
+
`h`がグローバルにインポートされるということは、Vue コンポーネントを含むライブラリはどれも `import { h } from 'vue'`という記述がどこかに含まれていることを意味します。結果として、ライブラリの著者はビルドにおいて適切に Vue の外部化を設定することが求められるので、少し手間が増えます:
136
137
137
-
- Vue should not be bundled into the library
138
-
-For module builds, the import should be left alone and be handled by the end user bundler
139
-
-For UMD / browser builds, it should try the global Vue.h first and fallback to require calls
0 commit comments