Поправки багов

This commit is contained in:
Book Pauk
2019-01-15 03:42:07 +07:00
parent 121d055419
commit dc1a57f319
3 changed files with 17 additions and 8 deletions

View File

@@ -51,6 +51,7 @@ import Component from 'vue-class-component';
export default @Component({
watch: {
rootRoute: function(newValue) {
this.setAppTitle();
if ((this.mode == 'reader' || this.mode == 'omnireader') && (newValue != '/reader')) {
this.$router.replace('/reader');
}
@@ -156,13 +157,14 @@ class App extends Vue {
const m = this.$route.path.match(/^(\/[^/]*).*$/i);
this.$root.rootRoute = (m ? m[1] : this.$route.path);
this.setAppTitle();
return this.$root.rootRoute;
}
setAppTitle(title) {
if (!title) {
if (this.config) {
if (this.mode == 'omnireader') {
document.title = `Omni Reader - всегда с вами`;
} else if (this.config) {
document.title = `${this.config.name} - ${this.itemRuText[this.$root.rootRoute]}`;
}
} else {