IonicsoilHeader.vue 2.3 KB
<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>