-
Notifications
You must be signed in to change notification settings - Fork 357
Expand file tree
/
Copy pathVersion.vue
More file actions
64 lines (62 loc) · 1.38 KB
/
Version.vue
File metadata and controls
64 lines (62 loc) · 1.38 KB
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
<script lang="ts">
import Vue from 'vue';
import { ipcRenderer } from '@pkg/utils/ipcRenderer';
export default Vue.extend({
props: {
icon: {
type: String,
default: '',
},
isStatusBarItem: {
type: Boolean,
default: false,
},
isProgressBarVisible: {
type: Boolean,
default: false,
},
},
data() {
return { version: this.t('product.versionChecking') };
},
computed: {
getTooltip(): { content: string, placement: string, classes: string } {
return {
content: `<b>${ this.t('product.version') }</b>: ${ this.version }`,
placement: 'top',
classes: 'tooltip-footer',
};
},
},
mounted() {
ipcRenderer.on('get-app-version', (event, version) => {
this.version = version;
});
ipcRenderer.send('get-app-version');
},
});
</script>
<template>
<span
v-tooltip="isStatusBarItem ? getTooltip : {}"
class="versionInfo"
>
<i
v-if="icon"
class="item-icon"
:class="{'make-icon-inline': isProgressBarVisible, icon: true}"
/>
<span
class="item-label"
:class="{'make-label-invisible': isProgressBarVisible}"
>
<b>{{ t('product.version') }}:</b>
</span>
<span
class="item-value"
:class="{'make-value-invisible': isProgressBarVisible}"
>
{{ version }}
</span>
</span>
</template>