/// <summary> /// 显示确认弹窗方法 /// </summary> protected async Task Show() { // 回调消费者逻辑 判断是否需要弹出确认框 if (await OnBeforeClick()) { // 生成客户端弹窗 PopoverService.Show(new PopoverConfirmOption() { ButtonId = Id, Title = Title, Content = Content, CloseButtonText = CloseButtonText, CloseButtonColor = CloseButtonColor, ConfirmButtonText = ConfirmButtonText, ConfirmButtonColor = ConfirmButtonColor, Icon = ConfirmIcon, OnConfirm = OnConfirm, OnClose = OnClose, Callback = async() => { // 调用 JS 进行弹窗 等待 弹窗点击确认回调 await JSRuntime.InvokeVoidAsync(Id, "bb_confirm"); } }); } }
/// <summary> /// 显示确认弹窗方法 /// </summary> protected void Show() { // 回调消费者逻辑 判断是否需要弹出确认框 if (OnBeforeClick()) { // 生成客户端弹窗 PopoverService?.Show(new PopoverConfirmOption() { ButtonId = Id, Title = Title, Content = Content, CloseButtonText = CloseButtonText, CloseButtonColor = CloseButtonColor, ConfirmButtonText = ConfirmButtonText, ConfirmButtonColor = ConfirmButtonColor, Icon = ConfirmIcon, OnConfirm = OnConfirm, OnClose = OnClose, Callback = new Action(async() => { // 调用 JS 进行弹窗 等待 弹窗点击确认回调 if (JSRuntime != null) { await JSRuntime.Invoke(Id, "confirm"); } }) }); } }