Skip to content

How does the button in the card respond to a click #25

Closed

Description

@JinLiGame

my code:
with ssui.card(key=f"card{index}"): ssui.element("p", children=[character["name"]], className="text-xl font-bold", key="label2") ssui.element("p", children=[f"id: {character['id']}"], className="text-sm font-medium m-1", key="label1") ssui.element("p", children=[f"创建时间: {character['create_time']}"], className="text-sm font-medium m-1", key="label3") btn = ssui.element("button", text="查看", key=f"button{index}") print(f"----------->btn:{btn.value}") if btn.value: grouter.redirect(*grouter.build("character_view_page", {"cid": character['id']}))

Activity

  1. ObservedObserver commented on Sep 12, 2026

    @ObservedObserver
    Owner

    V2 supports card button events through el.button(...). Read the handle's .clicked after leaving the ui.elements block, or use on_click. Upgrade to v1.4.0 and migrate the old card/element code using the Elements guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions