A barebones dotnet template for Vuejs 2.X using Single File Component.
Clone or download
Jaxelr Merge pull request #9 from Jaxelr/dependabot/nuget/Content/Microsoft.…
…AspNetCore.App-2.1.6

Bump Microsoft.AspNetCore.App from 2.1.5 to 2.1.6 in /Content
Latest commit ba0ec42 Nov 13, 2018

Readme.md

Vue Simple Template Mit License

This template was created to use vue.js with asp.net core using the Spa Services library. It aims to be minimalistic with its approach. It also favors Vue's single file component over Typescript, since one of the efforts is to minimize friction when transitioning from a vue-cli project into this template.

Builds

Appveyor
Build status

Packages

NuGet (Stable) MyGet (Prerelease)
NuGet MyGet

Installation

To install the template, via commandline simply using nuget:

dotnet new -i "Vue.Simple.Template::*"

where * is the equivalent of the latest version of the template.

If you would like to tinker with the code locally, you can clone the repository and execute the following command with the dotnet command, using the path of the repo:

dotnet new -i "$PATH_OF_NUPKG_FILE"

Once installed as a template you can properly create your own custom projects using the template using the following command:

dotnet new simplevue -o MyAppName

It will generate the following folder structure:

$
.
├── .editorconfig
├── appsettings.Development.json
├── appsettings.json
├── Program.cs
├── Startup.cs
├── {ProjectName}.csproj
├── /ClientApp
│   ├── package.json
│   ├── package-lock.json
│   ├── babel.config.js
│   ├── /public
│   │    ├── favicon.ico
│   │    └── index.html
│   ├── /src
│   │    ├── store.js
│   │    ├── router.js
│   │    ├── main.js
│   │    ├── app.vue
│   │    ├── /assets
│   │    │    └── logo.png
│   │    ├── /components
│   │    │    └── helloworld.vue
│   │    └── /views
│   │         ├── home.vue
│   │         └── about.vue
│   │
│   └── /node_modules
├── /Controllers
│   └── MainController.cs
└── /Views
    ├── _ViewStart.cshtml
    ├── _ViewImports.cshtml
    └── /Main
         └── Index.cshtml

Then proceed to:

cd MyAppName
npm install

The ClientApp folder includes the default project created using the vue-cli 3.0. You can (optionally) replace the contents of the clientApp folder with your own custom vue project, since this template interacts directly with the vue commands, for building and debugging purposes.


Uninstalling

The syntax for uninstalling from the command line is the following:

dotnet new -u "Vue.Simple.Template"

Or

dotnet new -u "$PATH_OF_NUPKG_FILE"

Further info

For More information on how to manage dotnet custom templates see the docs.microsoft documentation.

Contributing

Check the contribution guide.