├── content ├── ClientApp │ ├── store │ │ ├── api.js │ │ └── index.js │ ├── boot-app.js │ ├── router │ │ ├── index.js │ │ └── routes.js │ ├── boot-server.js │ ├── app.js │ ├── components │ │ ├── app-root.vue │ │ ├── counter-example.vue │ │ ├── nav-menu.vue │ │ ├── home-page.vue │ │ ├── about.vue │ │ └── fetch-data.vue │ ├── icons.js │ └── css │ │ └── site.css ├── Views │ ├── _ViewStart.cshtml │ ├── _ViewImports.cshtml │ ├── Home │ │ └── Index.cshtml │ └── Shared │ │ ├── Error.cshtml │ │ └── _Layout.cshtml ├── repo-example.png ├── appsettings.json ├── appsettings.Development.json ├── Providers │ ├── IWeatherProvider.cs │ └── WeatherProviderFake.cs ├── .editorconfig ├── Models │ └── WeatherForecast.cs ├── Controllers │ ├── HomeController.cs │ └── WeatherController.cs ├── Program.cs ├── web.config ├── Dockerfile ├── .eslintrc.js ├── .babelrc ├── Vue2Spa.sln ├── LICENSE.md ├── Vue2Spa.csproj ├── .template.config │ └── template.json ├── .gitattributes ├── webpack.config.vendor.js ├── Startup.cs ├── webpack.config.js ├── package.json ├── .gitignore └── README.md ├── .gitignore ├── .vscode ├── tasks.json └── launch.json ├── LICENSE.md ├── aspnetcore-vuejs.nuspec ├── .gitattributes ├── CODE_OF_CONDUCT.md └── README.md /content/ClientApp/store/api.js: -------------------------------------------------------------------------------- 1 | export function test () { 2 | 3 | } 4 | -------------------------------------------------------------------------------- /content/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Make sure nupkg files don't get pushed to git repo 2 | **/*.nupkg 3 | /.vs 4 | -------------------------------------------------------------------------------- /content/repo-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TrilonIO/aspnetcore-Vue-starter/HEAD/content/repo-example.png -------------------------------------------------------------------------------- /content/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning" 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /content/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Vue2Spa 2 | @addTagHelper "*, Microsoft.AspNetCore.Mvc.TagHelpers" 3 | @addTagHelper "*, Microsoft.AspNetCore.SpaServices" 4 | -------------------------------------------------------------------------------- /content/ClientApp/boot-app.js: -------------------------------------------------------------------------------- 1 | import './css/site.css' 2 | import 'core-js/es6/promise' 3 | import 'core-js/es6/array' 4 | 5 | import { app } from './app' 6 | 7 | app.$mount('#app') 8 | -------------------------------------------------------------------------------- /content/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ ViewData["Title"] = "Home Page"; } 2 | 3 |
4 | 5 | @section scripts { 6 | 7 | } 8 | -------------------------------------------------------------------------------- /content/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Error"; 3 | } 4 | 5 |Current time in Node is: ' + new Date() + '
' + 7 | 'Request path is: ' + params.location.path + '
' + 8 | 'Absolute URL is: ' + params.absoluteUrl + '
' 9 | 10 | resolve({ html: result }) 11 | }) 12 | }) 13 | -------------------------------------------------------------------------------- /content/ClientApp/app.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import axios from 'axios' 3 | import router from './router/index' 4 | import store from './store' 5 | import { sync } from 'vuex-router-sync' 6 | import App from 'components/app-root' 7 | import { FontAwesomeIcon } from './icons' 8 | 9 | // Registration of global components 10 | Vue.component('icon', FontAwesomeIcon) 11 | 12 | Vue.prototype.$http = axios 13 | 14 | sync(store, router) 15 | 16 | const app = new Vue({ 17 | store, 18 | router, 19 | ...App 20 | }) 21 | 22 | export { 23 | app, 24 | router, 25 | store 26 | } 27 | -------------------------------------------------------------------------------- /content/ClientApp/store/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import Vuex from 'vuex' 3 | 4 | Vue.use(Vuex) 5 | 6 | // TYPES 7 | const MAIN_SET_COUNTER = 'MAIN_SET_COUNTER' 8 | 9 | // STATE 10 | const state = { 11 | counter: 1 12 | } 13 | 14 | // MUTATIONS 15 | const mutations = { 16 | [MAIN_SET_COUNTER] (state, obj) { 17 | state.counter = obj.counter 18 | } 19 | } 20 | 21 | // ACTIONS 22 | const actions = ({ 23 | setCounter ({ commit }, obj) { 24 | commit(MAIN_SET_COUNTER, obj) 25 | } 26 | }) 27 | 28 | export default new Vuex.Store({ 29 | state, 30 | mutations, 31 | actions 32 | }) 33 | -------------------------------------------------------------------------------- /content/web.config: -------------------------------------------------------------------------------- 1 | 2 |This is a simple example of a Vue.js component & Vuex
6 | 7 |8 | Current count (Vuex): {{ currentCount }} 9 |
10 |11 | Auto count: {{ autoCount }} 12 |
13 | 14 | 15 | 16 |
16 |
17 |
18 | Powered by:
7 |To help you get started, we've also set up:
18 |webpack build tool. Your client-side resources are dynamically built on demand. Updates are available as soon
22 | as you modify any file.webpack build tool produces minified static CSS and JavaScript files.This component demonstrates fetching data from the server.
6 | 7 |Loading...
9 || Date | 17 |Temp. (C) | 18 |Temp. (F) | 19 |Summary | 20 |
|---|---|---|---|
| {{ forecast.dateFormatted }} | 25 |{{ forecast.temperatureC }} | 26 |{{ forecast.temperatureF }} | 27 |{{ forecast.summary }} | 28 |
15 |
16 |
17 |
18 |
143 |
144 |
145 |
146 |