Skip to content

Add clarification about inheritAttrs and class/style bindings (#1787) #1969

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/v2/guide/components-props.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ This can be especially useful in combination with the `$attrs` instance property

```js
{
class: 'username-input',
required: true,
placeholder: 'Enter your username'
}
```
Expand All @@ -337,12 +337,14 @@ Vue.component('base-input', {
})
```

<p class="tip">Note that `inheritAttrs: false` option does **not** affect `style` and `class` bindings.</p>

This pattern allows you to use base components more like raw HTML elements, without having to care about which element is actually at its root:

```html
<base-input
v-model="username"
class="username-input"
required
placeholder="Enter your username"
></base-input>
```