Skip to content

Commit

Permalink
update keep-alive api with array syntax (#973)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkzing authored and kazupon committed Jul 2, 2017
1 parent 640f418 commit 2a9946d
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/v2/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2107,8 +2107,8 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
### keep-alive
- **Props:**
- `include` - string or RegExp. Only components matched by this will be cached.
- `exclude` - string or RegExp. Any component matched by this will not be cached.
- `include` - string or RegExp or Array. Only components matched by this will be cached.
- `exclude` - string or RegExp or Array. Any component matched by this will not be cached.
- **Usage:**
Expand Down Expand Up @@ -2147,7 +2147,7 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
> New in 2.1.0
The `include` and `exclude` props allow components to be conditionally cached. Both props can either be a comma-delimited string or a RegExp:
The `include` and `exclude` props allow components to be conditionally cached. Both props can be a comma-delimited string, a RegExp or an Array:
``` html
<!-- comma-delimited string -->
Expand All @@ -2159,6 +2159,11 @@ All lifecycle hooks automatically have their `this` context bound to the instanc
<keep-alive :include="/a|b/">
<component :is="view"></component>
</keep-alive>

<!-- Array (use v-bind) -->
<keep-alive :include="['a', 'b']">
<component :is="view"></component>
</keep-alive>
```
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.
Expand Down

0 comments on commit 2a9946d

Please sign in to comment.