Rename ...props to props
This commit is contained in:
parent
a92d3e9ea2
commit
346fc7cb6c
2 changed files with 6 additions and 6 deletions
|
@ -17,7 +17,7 @@ It's
|
|||
- `nil`: Nothing is rendered.
|
||||
- `t`: Only the key is rendered.
|
||||
- non-boolean: The key/value pair is rendered.
|
||||
- `...props`: If the properties given to a component are not declared with `define-element` macro, they are gathered into `...props` property list. This allows flexible props passing to components.
|
||||
- `props`: If the properties given to a component are not declared with `define-element` macro, they are gathered into `props` property list. This allows flexible props passing to components.
|
||||
|
||||
```lisp
|
||||
(<>
|
||||
|
@ -28,7 +28,7 @@ It's
|
|||
; <div></div>
|
||||
|
||||
(define-element view-more ()
|
||||
(a ...props
|
||||
(a props
|
||||
"View More"))
|
||||
|
||||
(view-more :href "/detail" :class "m-1")
|
||||
|
@ -36,7 +36,7 @@ It's
|
|||
; <a href="/detail" class="m-1">View More</a>
|
||||
|
||||
(define-element custom-button (variant)
|
||||
(button `(:class ,variant ,@...props)
|
||||
(button `(:class ,variant ,@props)
|
||||
children))
|
||||
|
||||
(custom-button :type "submit" :variant "big" :onclick "doSomething()"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue