Vue.js and .net Core Templating

For a recent project, I need to integrate a front end framework with ASP.NET Core 2.0. After a bit of research on the ocean of JavaScript frameworks I landed on using Vue.js for the framework. It’s light, it’s easy to work with, and ramp up time should be minimal compared to something like Angular.

It now appears that .net has added a new Vue template for scaffolding. Here is how easy it is:
(Assuming you are on a Windows machine and have dotnet core installed )

Create an Empty Folder – wherever you want the project to live.

run dotnet new — this will give you a list of all the templates available for scaffolding. If you don’t see a Vue template simply type:
dotnet new --install Microsoft.AspNetCore.SpaTemplates::*

Now type dotnet new vue to scaffold a new Vue app template.

In milliseconds a complete new Vue.js single page web app is built with a working .Net Core back end with controllers, views etc. It’s brilliant. Just open the project is VS or VS Code and you’re away.

There are also templates for Aurelia, Angular, Knockout and React!

Leave a Comment