Skip to content

Commit 1b68103

Browse files
leopiccioniaphanan
authored andcommitted
Add clarification about inheritAttrs and class/style bindings (#1787) (#1969)
* Add note to the guide * Update example, removing `class` attribute to avoid confusion
1 parent 127443e commit 1b68103

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/v2/guide/components-props.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ This can be especially useful in combination with the `$attrs` instance property
313313

314314
```js
315315
{
316-
class: 'username-input',
316+
required: true,
317317
placeholder: 'Enter your username'
318318
}
319319
```
@@ -337,12 +337,14 @@ Vue.component('base-input', {
337337
})
338338
```
339339

340+
<p class="tip">Note that `inheritAttrs: false` option does **not** affect `style` and `class` bindings.</p>
341+
340342
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:
341343

342344
```html
343345
<base-input
344346
v-model="username"
345-
class="username-input"
347+
required
346348
placeholder="Enter your username"
347349
></base-input>
348350
```

0 commit comments

Comments
 (0)