Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoTod committed May 25, 2024
1 parent 003ce1d commit d5df2b6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/docs/src/en/advanced/csp.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,26 @@ Alpine.data('counter', () => ({
},
}))
```

The CSP build supports accessing nested properties (property accessors) using the dot notation.

```alpine
<!-- This works too -->
<div x-data="counter">
<button @click="foo.increment">Increment</button>
<span x-text="foo.count"></span>
</div>
```

```js
Alpine.data('counter', () => ({
foo: {
count: 1,

increment() {
this.count++
},
},
}))
```

0 comments on commit d5df2b6

Please sign in to comment.