76
rated 0 times
[
81]
[
5]
/ answers: 1 / hits: 19495
/ 6 Years ago, fri, april 6, 2018, 12:00:00
I used vue-cli with webpack to build up the vue project.
Then I installed vue-meta-info to set up the seo.
I want to set up the Page title with the templates and the route name.
However , I cannot get the variable in router.
rotuer/index.js
import Vue from 'vue';
import Router from 'vue-router';
import HelloWorld from '@/components/HelloWorld';
Vue.use(Router);
export default new Router({
mode: 'history',
routes: [
{
path: '/',
name: 'HelloWorld',
component: HelloWorld,
},
],
});
App.vue
<template>
<div id=app>
<router-view/>
</div>
</template>
<script>
export default {
name: 'App',
metaInfo: {
title: My Website - + route.name,
},
};
</script>
More From » vue.js