Skip to content
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

Merged
merged 6 commits into from
Aug 1, 2024

Conversation

VleaStwo
Copy link
Contributor

@VleaStwo VleaStwo commented Aug 1, 2024

MPagination

  • add MiniVariant MiniVariantChange
  • add MobileBreakpoint
  • When MiniVariant is not set, it will automatically switch based on the MasaBlazor.Breakpoint

@@ -8,18 +8,29 @@
<ul class="@_modifierBuilder.Add(Circle).Add(Disabled).AddTheme(IsDark, IndependentTheme)">
@GenPaginationIcon(PaginationIconType.First)

@foreach (var item in GetItems())
@if (prevMiniVariant)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prevMiniVariant 这个记录内部的mini状态吗?是的话改为 _internalMiniVariant 明了一些。

Comment on lines 319 to 322
if (IsDirtyParameter(nameof(MiniVariant)))
{
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (IsDirtyParameter(nameof(MiniVariant)))
{
return;
}

用户没有给MiniVariant参数内部也是要去判断状态的。


private bool CalMobileBreakpoint() => CalMobileBreakpoint(MasaBlazor, MobileBreakpoint);

private static bool CalMobileBreakpoint(MasaBlazor masaBlazor, OneOf<Breakpoints, double> mbpParam)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private static bool CalMobileBreakpoint(MasaBlazor masaBlazor, OneOf<Breakpoints, double> mbpParam)
private static bool IsMiniVaraint(MasaBlazor masaBlazor, OneOf<Breakpoints, double> mobileBreakpoint)

非必要不要用缩写。

return;
}

var isM = CalMobileBreakpoint();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var isM = CalMobileBreakpoint();
var isMiniVaraint = CalMobileBreakpoint();

protected override void OnInitialized()
{
MasaBlazor.WindowSizeChanged -= MasaBlazor_WindowSizeChanged;
MasaBlazor.WindowSizeChanged += MasaBlazor_WindowSizeChanged;
Copy link
Contributor

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;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可能需要调用base的oninit方法

Copy link
Contributor

@capdiem capdiem left a 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

@capdiem capdiem merged commit 8f5624d into masastack:main Aug 1, 2024
1 check passed
@capdiem
Copy link
Contributor

capdiem commented Aug 2, 2024

#2069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants