Skip to content

Commit b359d4e

Browse files
committed
make inheritAttrs and $attrs exception for class and style more prominent
1 parent f5b6092 commit b359d4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/v2/api/index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,8 @@ if (version === 2) {
11141114
11151115
By default, parent scope attribute bindings that are not recognized as props will "fallthrough" and be applied to the root element of the child component as normal HTML attributes. When authoring a component that wraps a target element or another component, this may not always be the desired behavior. By setting `inheritAttrs` to `false`, this default behavior can be disabled. The attributes are available via the `$attrs` instance property (also new in 2.4) and can be explicitly bound to a non-root element using `v-bind`.
11161116
1117+
Note: this option does **not** affect `class` and `style` bindings.
1118+
11171119
### comments
11181120
11191121
> New in 2.4.0+
@@ -1312,7 +1314,7 @@ if (version === 2) {
13121314
13131315
- **Details:**
13141316
1315-
Contains parent-scope attribute bindings that are not recognized (and extracted) as props. When a component doesn't have any declared props, this essentially contains all parent-scope bindings except for `class` and `style`, and can be passed down to an inner component via `v-bind="$attrs"` - useful when creating higher-order components.
1317+
Contains parent-scope attribute bindings (except for `class` and `style`) that are not recognized (and extracted) as props. When a component doesn't have any declared props, this essentially contains all parent-scope bindings (except for `class` and `style`), and can be passed down to an inner component via `v-bind="$attrs"` - useful when creating higher-order components.
13161318
13171319
### vm.$listeners
13181320

0 commit comments

Comments
 (0)