diff --git a/src/BootstrapBlazor.Server/Components/Samples/ContextMenus.razor b/src/BootstrapBlazor.Server/Components/Samples/ContextMenus.razor index 9a6b8934c1a..4af42e3448f 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/ContextMenus.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/ContextMenus.razor @@ -58,8 +58,15 @@ - - + @if (SelectModel?.Id == "1020") + { + + + } + else + { + + } diff --git a/src/BootstrapBlazor.Server/Components/Samples/ContextMenus.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/ContextMenus.razor.cs index 92e164927fa..72e358e2939 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/ContextMenus.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/ContextMenus.razor.cs @@ -41,15 +41,22 @@ protected override void OnInitialized() Items = Foo.GenerateFoo(LocalizerFoo); } + TreeFoo? SelectModel = default; private Task OnBeforeShowCallback(object? item) { if (item is TreeFoo foo) { _callbackLogger.Log($"{foo.Text} trigger"); + SelectModel = foo; } return Task.CompletedTask; } + + Task OnCopySub(ContextMenuItem item, object value) + { + return Task.CompletedTask; + } private bool OnDisabledCallback(ContextMenuItem item, object? context) { var ret = false; diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 3296cc0bd3d..98192d24d3b 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -6087,7 +6087,7 @@ "ContextMenuTreeTitle": "Tree", "ContextMenuTreeIntro": "Right click on the Tree to pop up a context menu", "ContextMenuCallbackTitle": "ContextMenu Callback", - "ContextMenuCallbackIntro": "By setting the ContextMenu component parameter OnBeforeShowCallback, you can get the callback event before the right-click menu pops up, which can be used for data preparation", + "ContextMenuCallbackIntro": "By setting the ContextMenu component parameter OnBeforeShowCallback, you can get the callback event before the right-click menu pops up, which can be used for data preparation or render menus based on conditions", "ContextMenuDisabledTitle": "OnDisabledCallback", "ContextMenuDisabledIntro": "By setting the ContextMenuItem component parameter OnDisabledCallback callback method, you can set whether the current right-click option is disabled." }, diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index bf20ae8ebef..4777c6c5f1a 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -6087,7 +6087,7 @@ "ContextMenuTreeTitle": "Tree 组件", "ContextMenuTreeIntro": "点击 Tree 组件行数据右键,弹出上下文关联菜单", "ContextMenuCallbackTitle": "ContextMenu 回调", - "ContextMenuCallbackIntro": "通过设置 ContextMenu 组件参数 OnBeforeShowCallback 获得右键菜单弹出前回调事件,可用于数据准备工作", + "ContextMenuCallbackIntro": "通过设置 ContextMenu 组件参数 OnBeforeShowCallback 获得右键菜单弹出前回调事件,可用于数据准备工作,也可按需渲染菜单", "ContextMenuDisabledTitle": "禁止回调方法", "ContextMenuDisabledIntro": "通过设置 ContextMenuItem 组件参数 OnDisabledCallback 回调方法可用于设置当前右键选项是否禁用逻辑" }, diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 665f76f8512..727ddeb2df1 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 9.2.8-beta02 + 9.2.8-beta03