feat(cli): set title by lang

This commit is contained in:
陈嘉涵
2019-12-09 17:07:01 +08:00
parent cf172f5cbc
commit 396002495f
10 changed files with 75 additions and 25 deletions

View File

@@ -65,6 +65,23 @@ export default {
watch: {
lang(val) {
setLang(val);
this.setTitle();
}
},
created() {
this.setTitle();
},
methods: {
setTitle() {
let { title } = this.config;
if (this.config.description) {
title += ` - ${this.config.description}`;
}
document.title = title;
}
}
};