Skip to content

Commit

Permalink
clearer example
Browse files Browse the repository at this point in the history
  • Loading branch information
sa- authored Nov 7, 2024
1 parent 463f277 commit 7e6199d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/docs/src/en/directives/bind.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ title: bind
For example, here's a component where we will use `x-bind` to set the placeholder value of an input.

```alpine
<div x-data="{ placeholder: 'Type here...' }">
<input type="text" x-bind:placeholder="placeholder">
<div x-data="{ placeholder_text: 'Type here...' }">
<input type="text" x-bind:placeholder="placeholder_text">
</div>
```

Expand All @@ -21,7 +21,7 @@ For example, here's a component where we will use `x-bind` to set the placeholde
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.

```alpine
<input type="text" :placeholder="placeholder">
<input type="text" :placeholder="placeholder_text">
```

> 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)
Expand Down

0 comments on commit 7e6199d

Please sign in to comment.