Skip to content

Commit b7b3202

Browse files
authored
fix: improve component attrs section (#541)
1 parent b417241 commit b7b3202

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/guide/component-attrs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
> This page assumes you've already read the [Components Basics](component-basics.md). Read that first if you are new to components.
44
5-
A component non-prop attribute is an attribute or event listener that is passed to a component, but does not have a corresponding property defined in [props](component-props) or [emits](component-custom-events.html#defining-custom-events). Common examples of this include `class`, `style`, and `id` attributes.
5+
A component non-prop attribute is an attribute or event listener that is passed to a component, but does not have a corresponding property defined in [props](component-props) or [emits](component-custom-events.html#defining-custom-events). Common examples of this include `class`, `style`, and `id` attributes. You can access those attributes via `$attrs` property.
66

77
## Attribute Inheritance
88

@@ -82,7 +82,7 @@ If you do **not** want a component to automatically inherit attributes, you can
8282

8383
The common scenario for disabling an attribute inheritance is when attributes need to be applied to other elements besides the root node.
8484

85-
By setting the `inheritAttrs` option to `false`, this gives you access to the component's `$attrs` property, which includes all attributes not included to component `props` and `emits` properties (e.g., `class`, `style`, `v-on` listeners, etc.).
85+
By setting the `inheritAttrs` option to `false`, you can control to apply to other elements attributes to use the component's `$attrs` property, which includes all attributes not included to component `props` and `emits` properties (e.g., `class`, `style`, `v-on` listeners, etc.).
8686

8787
Using our date-picker component example from the [previous section]('#attribute-inheritance), in the event we need to apply all non-prop attributes to the `input` element rather than the root `div` element, this can be accomplished by using the `v-bind` shortcut.
8888

0 commit comments

Comments
 (0)