I started to use Vue.js, alternatively to AngularJS, and I got a question on vue-router compared to angular-ui-router.
Every angular-ui-router user knows that something like this:
$stateProvider
.state('myState', {
url: '/my/url',
templateUrl: 'my/template/path/template.html',
controller: 'myTemplateController',
controllerAs: 'myAsController'
});
is (maybe?) one of the good way to use the uiRouter.
When I first got in touch with uiRouter I felt very comfortable on using it.
Now that I'm using vue-router, I wonder if it can handle something like the templateUrl attribute (I don't care about other attributes that, of course, may have no more sense with Vue.js) without every time write HTML code inside .js files (that's pretty ugly) but abstract it inside a partial view.
I'm asking this because in the official documentation every example is declared like:
const routes = [
{
path: '/my/url',
component: {
template: '<tag>html here or text or sth else...</tag>'
}
}
];
const router = new VueRouter({routes});
const app = new Vue({router}).$mount('#myApp');
and it's clear, well explained and works perfectly. But it's not what I'm looking for.
Searching first on Stackoverflow I got on my hands this thread which inside (maybe?) what I'm asking but I still cannot understand what is doing.