Posts

Showing posts with the label multi-page-application

Vue.js and structuring multi-page web apps - component registrations

Vue.js and structuring multi-page web apps - component registrations I want to use Vue.js for a MVC Core 2.1 multi-page web app, but I think my approach is a bit quirky. I have searched a lot for a better way to structure my code. I also took a look at how PHP Laravel 5.x does it, and it seems like they take the same approach as the one I use, kinda. I have created a main.js file where I register some of the components globablly, and the ones that are only used by specific components will of course be registered only locally. So, basically every page will have it's own component registered gloablly... (btw I use Webpack) main.js import Vue from 'vue'; import Axios from 'axios'; import BaseLayout from './components/layout/BaseLayout.vue'; import BaseHeaderLayout from './components/layout/BaseHeader.vue'; import HomeIndex from './components/home/Index.vue'; import HomeCreate from './components/home/Create.vue'; import 'bootstrap/d...