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/api/options-composition.md
+56-56Lines changed: 56 additions & 56 deletions
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,15 @@
2
2
3
3
## mixins
4
4
5
-
-**Type:**`Array<Object>`
5
+
-**型:**`Array<Object>`
6
6
7
-
-**Details:**
7
+
-**詳細:**
8
8
9
-
The `mixins`option accepts an array of mixin objects. These mixin objects can contain instance options like normal instance objects, and they will be merged against the eventual options using the certain option merging logic. For example, if your mixin contains a `created`hook and the component itself also has one, both functions will be called.
Allows declaratively extending another component (could be either a plain options object or a constructor). This is primarily intended to make it easier to extend between single file components.
This pair of options are used together to allow an ancestor component to serve as a dependency injector for all its descendants, regardless of how deep the component hierarchy is, as long as they are in the same parent chain. If you are familiar with React, this is very similar to React's `context`feature.
The `provide`option should be an object or a function that returns an object. This object contains the properties that are available for injection into its descendants. You can use ES2015 Symbols as keys in this object, but only in environments that natively support `Symbol`and`Reflect.ownKeys`.
68
+
`provide`オプションは、オブジェクトまたはオブジェクトを返す関数でなければなりません。このオブジェクトは、その子孫に注入可能なプロパティを含みます。このオブジェクトのキーには ES2015 の Symbol を使うことができますが、ネイティブで `Symbol`と`Reflect.ownKeys` をサポートしている環境でのみ有効です。
69
69
70
-
The `inject`option should be either:
70
+
`inject`オプションは、次のいずれかでなければなりません:
71
71
72
-
-an array of strings, or
73
-
-an object where the keys are the local binding name and the value is either:
74
-
-the key (string or Symbol) to search for in available injections, or
75
-
-an object where:
76
-
-the `from`property is the key (string or Symbol) to search for in available injections, and
> Note: the `provide`and`inject`bindings are NOT reactive. This is intentional. However, if you pass down a reactive object, properties on that object do remain reactive.
The `setup`function is a new component option. It serves as the entry point for using the Composition API inside components.
191
+
`setup`関数は、新しいコンポーネントオプションです。この関数は、コンポーネント内で Composition API を使うためのエントリポイントになります。
192
192
193
-
-**Invocation Timing**
193
+
-**呼び出しのタイミング**
194
194
195
-
`setup`is called right after the initial props resolution when a component instance is created. Lifecycle-wise, it is called before the [beforeCreate](./options-lifecycle-hooks.html#beforecreate)hook.
@@ -221,11 +221,11 @@ The `setup` function is a new component option. It serves as the entry point for
221
221
</script>
222
222
```
223
223
224
-
Note that[refs](refs-api.html#ref)returned from `setup` are automatically unwrapped when accessed in the template so there's no need for `.value`in templates.
@@ -240,9 +240,9 @@ The `setup` function is a new component option. It serves as the entry point for
240
240
}
241
241
```
242
242
243
-
-**Arguments**
243
+
-**引数**
244
244
245
-
The function receives the resolved props as its first argument:
245
+
この関数は、その第 1 引数として解決されたプロパティを受け取ります:
246
246
247
247
```js
248
248
exportdefault {
@@ -255,7 +255,7 @@ The `setup` function is a new component option. It serves as the entry point for
255
255
}
256
256
```
257
257
258
-
Note this `props`object is reactive - i.e. it is updated when new props are passed in, and can be observed and reacted upon using `watchEffect`or`watch`:
@@ -299,23 +299,23 @@ The `setup` function is a new component option. It serves as the entry point for
299
299
}
300
300
```
301
301
302
-
`attrs`and`slots`are proxies to the corresponding values on the internal component instance. This ensures they always expose the latest values even after updates so that we can destructure them without worrying about accessing a stale reference:
-Having `props`as a separate argument makes it easier to type it individually without messing up the types of other properties on the context. It also makes it possible to keep a consistent signature across `setup`, `render` and plain functional components with TSX support.
0 commit comments