Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Oxpecker.Solid.FablePlugin/Library.fs
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ module internal rec AST =
| "bool", EventHandler(eventName, handler) -> ("bool:" + eventName, handler) :: restResults
| "data", EventHandler(eventName, handler) -> ("data-" + eventName, handler) :: restResults
| "attr", EventHandler(eventName, handler) -> (eventName, handler) :: restResults
| "spread", { Args = [ _; identExpr ] } -> ("__SPREAD_PROPERTY__", identExpr) :: restResults
| "ref", { Args = [ _; identExpr ] } -> ("ref", identExpr) :: restResults
| "style'", { Args = [ _; identExpr ] } -> ("style", identExpr) :: restResults
| "classList", { Args = [ _; identExpr ] } -> ("classList", identExpr) :: restResults
Expand Down
5 changes: 5 additions & 0 deletions src/Oxpecker.Solid/Tags.fs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ module Tags =
[<Extension; Erase>]
static member attr(this: #HtmlTag, name: string, value: string) = this

/// Applies JS Object Spread to the given value within the given element. Care must be taken to provide valid
/// objects. Mostly used to pass on properties in bindings/imports to nested children.
[<Extension; Erase>]
static member spread(this: #HtmlTag, value: 'T) = this

/// Add event handler to the element through the corresponding attribute
[<Extension; Erase>]
static member on(this: #HtmlTag, eventName: string, eventHandler: Event -> unit) = this
Expand Down