mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-02 12:09:59 +08:00
fix(#I1ETE1): 确认弹窗组件切换页面报错
#Comment 确认弹窗脚本错误 #Issue close https://gitee.com/LongbowEnterprise/BootstrapBlazor/issues/I1ETE1
This commit is contained in:
parent
e3548a82c1
commit
45fdbc62bb
@ -11,7 +11,10 @@ namespace BootstrapBlazor.Components
|
||||
/// </summary>
|
||||
public abstract class PopConfirmButtonBase : ButtonBase
|
||||
{
|
||||
private JSInterop<PopConfirmButtonBase>? Interop { get; set; }
|
||||
/// <summary>
|
||||
/// 获得/设置 JSInterop 实例
|
||||
/// </summary>
|
||||
protected JSInterop<PopConfirmButtonBase>? Interop { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 PopoverConfirm 服务实例
|
||||
@ -149,7 +152,7 @@ namespace BootstrapBlazor.Components
|
||||
/// <param name="disposing"></param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && Interop != null) Interop.Dispose();
|
||||
if (disposing) Interop?.Dispose();
|
||||
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
@ -10,6 +10,9 @@ namespace BootstrapBlazor.Components
|
||||
{
|
||||
private Action? Callback { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 获得/设置 内部确认弹窗引用
|
||||
/// </summary>
|
||||
public (PopoverConfirmOption Option, RenderFragment RenderFragment)? ConfirmBox { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
@ -396,9 +396,14 @@
|
||||
return;
|
||||
}
|
||||
|
||||
$ele.fadeHide(function () {
|
||||
el.invokeMethodAsync(method);
|
||||
});
|
||||
var $pop = $('[data-target="' + id + '"]');
|
||||
if ($pop.length > 0) {
|
||||
var href = window.location.href;
|
||||
$pop.fadeHide(function () {
|
||||
var _href = window.location.href;
|
||||
if (href === _href) el.invokeMethodAsync(method);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('.popover-confirm-container').on('click', 'popover-confirm-buttons .btn', function (e) {
|
||||
|
Loading…
Reference in New Issue
Block a user