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 2.6.0+, this hook also captures errors thrown inside `v-on` DOM listeners. In addition, if any of the covered hooks or handlers returns a Promise chain (e.g. async functions), the error from that Promise chain will also be handled.
The returned object can be used directly inside [render functions](../guide/render-function.html)and [computed properties](../guide/computed.html), and will trigger appropriate updates when mutated. It can also be used as a minimal, cross-component state store for simple scenarios:
420
+
戻り値のオブジェクトは、[描画関数](../guide/render-function.html)や [算出プロパティ](../guide/computed.html) の中で直接使え、値が変更されたときには適切な更新をトリガーします。単純なシナリオでは、コンポーネントをまたぐ最小の state ストアとして使用することもできます:
421
421
422
422
```js
423
423
conststate=Vue.observable({ count:0 })
@@ -431,9 +431,9 @@ updated: 2019-02-11
431
431
}
432
432
```
433
433
434
-
<pclass="tip">In Vue 2.x, `Vue.observable` directly mutates the object passed to it, so that it is equivalent to the object returned, as [demonstrated here](../guide/instance.html#Data-and-Methods). In Vue 3.x, a reactive proxy will be returned instead, leaving the original object non-reactive if mutated directly. Therefore, for future compatibility, we recommend always working with the object returned by `Vue.observable`, rather than the object originally passed to it.</p>
**Note:**since 2.6.0+, there are two notable changes to this property:
1437
+
**注意:** 2.6.0 以降では、このプロパティに特筆すべき変更が 2 つあります:
1438
1438
1439
-
1.Scoped slot functions are now guaranteed to return an array of VNodes, unless the return value is invalid, in which case the function will return `undefined`.
2.All`$slots`are now also exposed on `$scopedSlots`as functions. If you work with render functions, it is now recommended to always access slots via `$scopedSlots`, whether they currently use a scope or not. This will not only make future refactors to add a scope simpler, but also ease your eventual migration to Vue 3, where all slots will be functions.
In 2.6+, `v-for` can also work on values that implement the [Iterable Protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol), including native `Map` and `Set`. However, it should be noted that Vue 2.xcurrently does not support reactivity on `Map` and `Set` values, so cannot automatically detect changes.
<!-- shorthand dynamic attribute name (2.6.0+) -->
2154
+
<!-- 動的な属性名の省略記法 (2.6.0 以降) -->
2155
2155
<button :[key]="value"></button>
2156
2156
2157
2157
<!-- インライン文字列連結 -->
@@ -2220,24 +2220,24 @@ updated: 2019-02-11
2220
2220
2221
2221
### v-slot
2222
2222
2223
-
- **Shorthand:** `#`
2223
+
- **省略記法:** `#`
2224
2224
2225
-
- **Expects:** JavaScript expression that is valid in a function argument position (supports destructuring in [supported environments](../guide/components-slots.html#Slot-Props-Destructuring)). Optional - only needed if expecting props to be passed to the slot.
Used to denote an element or component as a scoped slot. The attribute's value should be a valid JavaScript expression that can appear in the argument position of a function signature. This means in supported environments you can also useES2015 destructuring in the expression. Serves as a replacement for [`scope`](#scope-replaced) in 2.5.0+.
0 commit comments