-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.vue
75 lines (64 loc) · 1.62 KB
/
index.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
67
68
69
70
71
72
73
74
75
<template>
<div class="root">
<nav v-if="ui_state === 'hello' || ui_state === 'updated' || !pwd" @click="$store.commit('ui/open', pwd? null : 'settings')">
{{ name }} v{{ version }} '{{ releasename }}'
<br />
<label v-if="!pwd">
위치를 확인할 수 없습니다.
</label>
<label v-else-if="ui_state === 'updated'">
업데이트되었습니다.
</label>
<label v-else>
날씨 아이콘을 클릭해서 메뉴를 열 수 있습니다.
</label>
</nav>
<overlay />
<settings v-if="ui_state === 'settings'"/>
</div>
</template>
<script>
import { mapState } from 'vuex'
import packageinfo from './package.json'
import Overlay from './components/overlay'
import Settings from './components/settings'
export default {
components: {
Overlay,
Settings
},
data: () => ({
name: packageinfo.name,
version: packageinfo.version,
releasename: packageinfo.releasename
}),
methods: {
open(w) { this.$store.commit('ui/open') }
},
computed: {
...mapState('settings', [ 'pwd' ]),
...mapState('ui', [ 'ui_state' ])
},
mounted() {
const lv = this.$store.state.settings.last_version
if(lv !== packageinfo.version) {
this.$store.commit('ui/open', lv? 'updated' : 'hello')
this.$store.commit('settings/set', {
k: 'last_version',
v: packageinfo.version
})
}
}
}
</script>
<style lang="sass">
@import styles/variables
@import styles/index
@import styles/elements
html, body, #vue-root, .root
height: 100%
.root
display: flex
flex-direction: column
align-items: stretch
</style>