Skip to content

Commit 4e99f08

Browse files
calebporzioclaude
andauthored
docs: disambiguate variable name from attribute in x-bind example (#4742)
Rename `placeholder` to `placeholderText` in the x-bind docs example so the variable name doesn't collide with the HTML placeholder attribute. Cherry-picked from #4430 by @sa- with camelCase fix applied. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 68d7f94 commit 4e99f08

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • packages/docs/src/en/directives

packages/docs/src/en/directives/bind.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ title: bind
1010
For example, here's a component where we will use `x-bind` to set the placeholder value of an input.
1111

1212
```alpine
13-
<div x-data="{ placeholder: 'Type here...' }">
14-
<input type="text" x-bind:placeholder="placeholder">
13+
<div x-data="{ placeholderText: 'Type here...' }">
14+
<input type="text" x-bind:placeholder="placeholderText">
1515
</div>
1616
```
1717

@@ -21,7 +21,7 @@ For example, here's a component where we will use `x-bind` to set the placeholde
2121
If `x-bind:` is too verbose for your liking, you can use the shorthand: `:`. For example, here is the same input element as above, but refactored to use the shorthand syntax.
2222

2323
```alpine
24-
<input type="text" :placeholder="placeholder">
24+
<input type="text" :placeholder="placeholderText">
2525
```
2626

2727
> Despite not being included in the above snippet, `x-bind` cannot be used if no parent element has `x-data` defined. [→ Read more about `x-data`](/directives/data)

0 commit comments

Comments
 (0)