refactor(frontend): remove $store
This commit is contained in:
parent
a9f0bea60c
commit
c823cbe63b
42 changed files with 150 additions and 113 deletions
|
|
@ -42,7 +42,7 @@ import XHeader from './header.vue';
|
|||
import { host, instanceName } from '@/config';
|
||||
import * as os from '@/os';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
import { ColdDeviceStorage } from '@/store';
|
||||
import { defaultStore, ColdDeviceStorage } from '@/store';
|
||||
import { mainRouter } from '@/router';
|
||||
|
||||
const DESKTOP_THRESHOLD = 1100;
|
||||
|
|
@ -66,6 +66,7 @@ export default defineComponent({
|
|||
},
|
||||
mainRouter,
|
||||
isDesktop: window.innerWidth >= DESKTOP_THRESHOLD,
|
||||
defaultStore,
|
||||
};
|
||||
},
|
||||
|
||||
|
|
@ -74,7 +75,7 @@ export default defineComponent({
|
|||
return {
|
||||
'd': () => {
|
||||
if (ColdDeviceStorage.get('syncDeviceDarkMode')) return;
|
||||
this.$store.set('darkMode', !this.$store.state.darkMode);
|
||||
this.defaultStore.set('darkMode', !this.defaultStore.state.darkMode);
|
||||
},
|
||||
's': () => {
|
||||
mainRouter.push('/search');
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<Transition :name="$store.state.animation ? 'tray-back' : ''">
|
||||
<Transition :name="'tray-back'">
|
||||
<div
|
||||
v-if="showMenu"
|
||||
class="menu-back _modalBg"
|
||||
|
|
@ -33,7 +33,7 @@
|
|||
></div>
|
||||
</Transition>
|
||||
|
||||
<Transition :name="$store.state.animation ? 'tray' : ''">
|
||||
<Transition :name="'tray'">
|
||||
<div v-if="showMenu" class="menu">
|
||||
<MkA to="/" class="link" active-class="active"><i class="ti ti-home icon"></i>{{ $ts.home }}</MkA>
|
||||
<MkA v-if="isTimelineAvailable" to="/timeline" class="link" active-class="active"><i class="ti ti-message icon"></i>{{ $ts.timeline }}</MkA>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue