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/v2/api/index.md
+8-3
Original file line number
Diff line number
Diff line change
@@ -2107,8 +2107,8 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
2107
2107
### keep-alive
2108
2108
2109
2109
- **Props:**
2110
-
- `include` - string or RegExp. Only components matched by this will be cached.
2111
-
- `exclude` - string or RegExp. Any component matched by this will not be cached.
2110
+
- `include` - string or RegExp or Array. Only components matched by this will be cached.
2111
+
- `exclude` - string or RegExp or Array. Any component matched by this will not be cached.
2112
2112
2113
2113
- **Usage:**
2114
2114
@@ -2147,7 +2147,7 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
2147
2147
2148
2148
> New in 2.1.0
2149
2149
2150
-
The `include` and `exclude` props allow components to be conditionally cached. Both props can either be a comma-delimited string or a RegExp:
2150
+
The `include` and `exclude` props allow components to be conditionally cached. Both props can be a comma-delimited string, a RegExp or an Array:
2151
2151
2152
2152
``` html
2153
2153
<!-- comma-delimited string -->
@@ -2159,6 +2159,11 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
2159
2159
<keep-alive :include="/a|b/">
2160
2160
<component :is="view"></component>
2161
2161
</keep-alive>
2162
+
2163
+
<!--Array (use v-bind) -->
2164
+
<keep-alive :include="['a', 'b']">
2165
+
<component :is="view"></component>
2166
+
</keep-alive>
2162
2167
```
2163
2168
2164
2169
The match is first checked on the component's own `name` option, then its local registration name (the key in the parent's `components` option) if the `name` option is not available. Anonymous components cannot be matched against.
0 commit comments