Skip to content

Blazor 需要 MVVM吗? #1430

Answered by ArgoZhang
TruePluto asked this question in Q&A

You must be logged in to vote

@TruePluto Blazor 本身就是 MVVM 模式,微软也推荐这种模式,但是也支持传统的模式 ref 拿到组件实例,开发中尽量使用 MVVM 模式

这个模式主要是通过 EventCallback 来实现的,下面我给你一些参考资料

https://learn.microsoft.com/en-us/aspnet/core/blazor/components/event-handling?WT.mc_id=DT-MVP-5004174&view=aspnetcore-7.0#eventcallback

https://www.bilibili.com/video/BV1ZM411J7Z7/?spm_id_from=333.999.0.0&vd_source=d2d36c90ff4b675b5c3e044432a65bec

这个系列是我录制的免费视频,建议从头看一下。对 Blazor 会有一个比较完整清晰的认识

Replies: 2 comments

You must be logged in to vote
0 replies
Answer selected by ArgoZhang

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants