按钮用于开始一个即时操作,是最常用的 AntdUI 控件之一。
import win.ui;
/*DSG{{*/
var winform = win.form(text="AntdUI Button";right=420;bottom=220)
winform.add(
host={cls="custom.button";text="提交";left=40;top=40;right=180;bottom=80;z=1}
)
/*}}*/
import dotNet.AntdUI;
var btn = AntdUI.Button(winform.host);
btn.Type = AntdUI.TTypeMini.Primary;
btn.Shape = AntdUI.TShape.Round;
btn.Click = function(sender,e){
AntdUI.Message.success(btn.Parent,"已提交");
}
winform.show();
win.loopMessage();
Text:按钮文字。Type:AntdUI.TTypeMini.Default/Primary/Success/Error/Warn/Info。Shape:AntdUI.TShape.Default/Circle/Round。Ghost:幽灵按钮。Loading:加载中。AutoToggle / Toggle:切换按钮。IconSvg / IconPosition:图标与位置。btn.Click = function(sender,e){
// 单击
}
btn.ToggleChanged = function(sender,e){
// Toggle 状态改变
}