Added Commands Management
This commit is contained in:
11
src/myfasthtml/controls/button.py
Normal file
11
src/myfasthtml/controls/button.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from fasthtml.components import *
|
||||
|
||||
from myfasthtml.core.commands import Command
|
||||
|
||||
|
||||
def mk_button(element, command: Command = None, **kwargs):
|
||||
if command is None:
|
||||
return Button(element, **kwargs)
|
||||
|
||||
htmx = command.get_htmx_params()
|
||||
return Button(element, **htmx, **kwargs)
|
||||
Reference in New Issue
Block a user