-
-
Notifications
You must be signed in to change notification settings - Fork 384
perf(Message): improve performance #7094
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
30ad21c
doc: 更新示例
ArgoZhang d8d926e
chore: 更新字典
ArgoZhang 5551e77
refactor: 精简代码
ArgoZhang e270070
refactor: 移除 Clear 方法参数传递
ArgoZhang 178fac8
chore: 增加字典
ArgoZhang d87ea23
feat: 支持全局配置自动隐藏时长设置
ArgoZhang 1068ab6
doc: 更新注释
ArgoZhang 6ace02d
feat: 精简反转逻辑
ArgoZhang 13c83f6
refactor: 更新 Clear 方法
ArgoZhang 52b901b
chore: 增加命名空间
ArgoZhang 52e7f31
refactor: 更新 init 接口参数
ArgoZhang acb9295
refactor: 重构 Dismiss 逻辑提高性能
ArgoZhang 0c6cb44
fix: 修复异步消息未清除 dom 问题
ArgoZhang 964663d
refactor: 更新关闭逻辑
ArgoZhang aeb989e
refactor: 移除 click 事件委托
ArgoZhang a25b6dc
refactor: 精简代码
ArgoZhang 898d8f1
test: 更新单元测试
ArgoZhang 8143f1f
refactor: 精简代码
ArgoZhang d894f8f
perf: 提高性能
ArgoZhang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,3 +121,5 @@ dotx | |
| Modbus | ||
| Protocol | ||
| vditor | ||
| alertdialog | ||
| blazorbootstrap | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,59 +1,29 @@ | ||
| @namespace BootstrapBlazor.Components | ||
| @namespace BootstrapBlazor.Components | ||
| @inherits BootstrapModuleComponentBase | ||
| @attribute [BootstrapModuleAutoLoader(JSObjectReference = true)] | ||
|
|
||
| <div id="@Id" class="@ClassString" style="@StyleName" role="alert"> | ||
| @if (Placement == Placement.Top) | ||
| @foreach (var item in MessagesForRender) | ||
| { | ||
| foreach (var item in _messages) | ||
| { | ||
| <div @key="item" id="@GetItemId(item)" role="alertdialog" class="@GetItemClassString(item)" data-bb-autohide="@GetAutoHideString(item)" data-bb-delay="@item.Delay"> | ||
| @if (!string.IsNullOrEmpty(item.Icon)) | ||
| <div @key="item" id="@GetItemId(item)" role="alertdialog" class="@GetItemClassString(item)" data-bb-autohide="@GetAutoHideString(item)" data-bb-delay="@item.Delay"> | ||
| @if (!string.IsNullOrEmpty(item.Icon)) | ||
| { | ||
| <i class="@item.Icon"></i> | ||
| } | ||
| <div> | ||
| @if (item.ChildContent != null) | ||
| { | ||
| <i class="@item.Icon"></i> | ||
| @item.ChildContent | ||
| } | ||
| <div> | ||
| @if (item.ChildContent != null) | ||
| { | ||
| @item.ChildContent | ||
| } | ||
| else | ||
| { | ||
| @item.Content | ||
| } | ||
| </div> | ||
| @if (item.ShowDismiss) | ||
| else | ||
| { | ||
| <button type="button" class="btn-close" aria-label="close"></button> | ||
| @item.Content | ||
| } | ||
| </div> | ||
| } | ||
| } | ||
| else | ||
| { | ||
| for (var index = _messages.Count; index > 0; index--) | ||
| { | ||
| var item = _messages[index - 1]; | ||
| <div @key="item" id="@GetItemId(item)" role="alertdialog" class="@GetItemClassString(item)" data-bb-autohide="@GetAutoHideString(item)" data-bb-delay="@item.Delay"> | ||
| @if (!string.IsNullOrEmpty(item.Icon)) | ||
| { | ||
| <i class="@item.Icon"></i> | ||
| } | ||
| <div> | ||
| @if (item.ChildContent != null) | ||
| { | ||
| @item.ChildContent | ||
| } | ||
| else | ||
| { | ||
| @item.Content | ||
| } | ||
| </div> | ||
| @if (item.ShowDismiss) | ||
| { | ||
| <button type="button" class="btn-close" aria-label="close"></button> | ||
| } | ||
| </div> | ||
| } | ||
| @if (item.ShowDismiss) | ||
| { | ||
| <button type="button" class="btn-close" aria-label="close"></button> | ||
| } | ||
| </div> | ||
| } | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.