perf(i18n): add generateTitle to utils

This commit is contained in:
Pan
2017-12-06 14:18:28 +08:00
parent d09923ff4f
commit acebaeae0c
4 changed files with 12 additions and 8 deletions

View File

@@ -10,6 +10,8 @@
</template>
<script>
import { generateTitle } from '@/utils/i18n'
export default {
created() {
this.getBreadcrumb()
@@ -25,6 +27,7 @@ export default {
}
},
methods: {
generateTitle,
getBreadcrumb() {
let matched = this.$route.matched.filter(item => item.name)
const first = matched[0]
@@ -32,9 +35,6 @@ export default {
matched = [{ path: '/dashboard', meta: { title: 'dashboard' }}].concat(matched)
}
this.levelList = matched
},
generateTitle(title) {
return this.$t('route.' + title)
}
}
}