|
@@ -1,6 +1,5 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
-
|
|
|
<router-view v-slot="{ Component }">
|
|
|
<keep-alive>
|
|
|
<component :is="Component" />
|
|
@@ -38,6 +37,17 @@ class CardIndex {
|
|
|
_options = componentOptions;
|
|
|
selectedTab = null;
|
|
|
|
|
|
+ created() {
|
|
|
+ this.$watch(
|
|
|
+ () => this.$route.path,
|
|
|
+ (newValue) => {
|
|
|
+ if (newValue == '/cardindex' && this.isReader) {
|
|
|
+ this.$router.replace({ path: '/reader' });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+
|
|
|
mounted() {
|
|
|
this.setTabByRoute(this.curRoute);
|
|
|
}
|
|
@@ -60,11 +70,19 @@ class CardIndex {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ get mode() {
|
|
|
+ return this.$store.state.config.mode;
|
|
|
+ }
|
|
|
+
|
|
|
get curRoute() {
|
|
|
const m = this.$route.path.match(/^(\/[^/]*\/[^/]*).*$/i);
|
|
|
return (m ? m[1] : this.$route.path);
|
|
|
}
|
|
|
|
|
|
+ get isReader() {
|
|
|
+ return (this.mode !== null && (this.mode == 'reader' || this.mode == 'omnireader' || this.mode == 'liberama.top'));
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
export default vueComponent(CardIndex);
|