-
Notifications
You must be signed in to change notification settings - Fork 160
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
🆕 feat(MPagination): Added MiniVariant MiniVariantChange and MobileBr… #2072
Conversation
@@ -8,18 +8,29 @@ | |||
<ul class="@_modifierBuilder.Add(Circle).Add(Disabled).AddTheme(IsDark, IndependentTheme)"> | |||
@GenPaginationIcon(PaginationIconType.First) | |||
|
|||
@foreach (var item in GetItems()) | |||
@if (prevMiniVariant) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prevMiniVariant 这个记录内部的mini状态吗?是的话改为 _internalMiniVariant 明了一些。
if (IsDirtyParameter(nameof(MiniVariant))) | ||
{ | ||
return; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (IsDirtyParameter(nameof(MiniVariant))) | |
{ | |
return; | |
} |
用户没有给MiniVariant参数内部也是要去判断状态的。
|
||
private bool CalMobileBreakpoint() => CalMobileBreakpoint(MasaBlazor, MobileBreakpoint); | ||
|
||
private static bool CalMobileBreakpoint(MasaBlazor masaBlazor, OneOf<Breakpoints, double> mbpParam) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static bool CalMobileBreakpoint(MasaBlazor masaBlazor, OneOf<Breakpoints, double> mbpParam) | |
private static bool IsMiniVaraint(MasaBlazor masaBlazor, OneOf<Breakpoints, double> mobileBreakpoint) |
非必要不要用缩写。
return; | ||
} | ||
|
||
var isM = CalMobileBreakpoint(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var isM = CalMobileBreakpoint(); | |
var isMiniVaraint = CalMobileBreakpoint(); |
protected override void OnInitialized() | ||
{ | ||
MasaBlazor.WindowSizeChanged -= MasaBlazor_WindowSizeChanged; | ||
MasaBlazor.WindowSizeChanged += MasaBlazor_WindowSizeChanged; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
少了在disposeasynccore里移除事件吧
{ | ||
MasaBlazor.WindowSizeChanged -= MasaBlazor_WindowSizeChanged; | ||
MasaBlazor.WindowSizeChanged += MasaBlazor_WindowSizeChanged; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可能需要调用base的oninit方法
Co-authored-by: capdiem <capdiem@live.com>
Co-authored-by: capdiem <capdiem@live.com>
Co-authored-by: capdiem <capdiem@live.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Lee-Lily-Lea
MPagination
MiniVariant
MiniVariantChange
MobileBreakpoint
MiniVariant
is not set, it will automatically switch based on theMasaBlazor.Breakpoint