/
App.vue
66 lines (62 loc) · 1.3 KB
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<template>
<div id="app">
<app-wallet v-if="isWallet" />
<router-view v-else />
</div>
</template>
<script>
import { mapState } from "vuex";
import AppWallet from "./AppWallet";
export default {
name: "App",
components: {
AppWallet
},
created() {
this.changeLanguage(this.language);
document.querySelector("html").dataset.theme = this.theme;
},
watch: {
language() {
this.changeLanguage(this.language);
},
theme() {
document.querySelector("html").dataset.theme = this.theme;
}
},
computed: {
...mapState("app", ["language", "theme"]),
isWallet() {
switch (window.location.hash.toLowerCase()) {
case "#/debug":
return false;
case "#/about":
return false;
default:
return true;
}
}
},
methods: {
changeLanguage(language) {
if (this.$i18n.locale === language) return;
this.$i18n.locale = language;
this.$forceUpdate();
}
}
};
</script>
<style lang="less">
@import "./css/app.less";
*,
#app {
font-family: euclid, Helvetica, sans-serif;
font-style: normal;
font-weight: 400;
font-size: 15px;
-webkit-text-size-adjust: none;
text-rendering: optimizeLegibility;
font-variant-ligatures: none;
-webkit-font-smoothing: antialiased;
}
</style>