1
2
3
4
5
6
7
8
9
10
11
12
13
14
import solara @solara.component def CounterApp(): count = solara.reactive(0) # 聲明反應式變量 def increment(): count.value += 1 # 用戶界面設置 solara.Button("Increment", on_click=increment) solara.Text(f"Current count: {count.value}")