How do you design frontend using JS framework for ASP.NET (Core)?
Hello fellow .NET devs,
I would like to know how do you bake in frontend frameworks into your .NET code. I want to talk about .NET Core + ASP.NET Core + Vue.js, but essentially it doesn't matter. Both new projects and integration into existing systems. The question comes from two projects that I worked in.
One of them was using Razor Pages and was embedding small Vue apps into separate pages. They had e.g. /Reports page that had standard Razor layout (_Layout = "") with one <div id="app"></div>. That Vue app was usually small, but I saw a few that had router to navigate between few components (few reports, tables, etc.).
The other one was using .NET Core integration with .AddSpaStaticFiles() and app.UseSpa(), so it was built using VueCLI, Vue templates and .NET was used pretty much only for API calls.
What is your opinion on these approaches? Would you rather do standard Razor pages or full frontend framwork? To be honest I like Razor approach, because I can treat it like standard ASP.NET MVC and handle things like authorisation with ease, but I browsed through some tutorials recently and they used VueCLI with full-blown JS for everything.
0 comments:
Post a Comment