IonicsoilHeader.vue
2.3 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<template>
<div class="n_header">
<div style="font-size:18px;line-hight:42px;margin-top:26px;">
{{$t('IonicHome.title')}}
</div>
<div style="position:absolute;right:38px;line-hight:25px;margin-top:23px;"><span class="lanopacity"><fv-DropDown class="lanopacity" :options="lists" style="
width: 102px;" @change="selectModel($event)" :placeholder="$t('language.name')" theme="dark">
<template v-slot:lists="item">
<p>{{item.text}}</p>
</template></fv-DropDown></span></div>
</div>
</template>
<script>
export default {
name: 'Home',
data() {
return {
lists:[
{ key: "zh", text: "简体中文" },
{ key: "cn", text: "繁体中文" },
{ key: "en", text: "English" },
{ key: "ja", text: "日本語" },
],
asbox:false,
timer:'',
date:new Date(),
input4:'',
myChart:''
}
},
components: {
},
computed:{
},
methods:{
getTime(){
let _this = this;
let a=this.$t('language.local')
this.timer = setInterval(function(){
_this.date = new Date().toLocaleString(a);
});
},
toHome(){
this.$router.push('/Home');
},
selectModel(v){
let lang = v.option.key;
this.$i18n.locale = lang;
localStorage.setItem("lang", lang);
clearInterval(this.timer);
this.getTime();
},
logoOut(){
this.$infoBox(this.$t('backTips.content'), {
status: 'correct',
title: this.$t('backTips.title'),
confirmTitle: this.$t('backTips.confirm'),
cancelTitle: this.$t('backTips.cancel'),
confirm: () => { this.$router.push('/Login') },
cancel: () => { this.asidebox; },
// theme: 'dark'
});
},
asidebox(){
this.asbox=!this.asbox;
},
},
mounted() {
this.getTime();
},
}
</script>
<style scoped lang="less">
@import url('../styles/IonicsoilHeader.less');
.el-main{
padding: 0 !important;
background-color: #242424;
}
.more-font{
font-size: 0.75rem !important;
transform: scale(0.75);
-webkit-transform-origin-x: 0;
}
.selectColor{
background-color: black;
color: white;
}
</style>