<template>
  <div id="app">
    <router-view />
    <theme-picker />
  </div>
</template>

<script>
import ThemePicker from "@/components/ThemePicker";
import Cookies from "js-cookie";

export default {
  name: "App",
  components: { ThemePicker },
  data(){
    return{
      b:false,
    }
  },
  destroyed: function () { // 离开页面生命周期函数
    this.$websocket.dispatch('websocket_close');
  },
  created () {
    const username = Cookies.get('username')
    this.$store.dispatch('websocket_init', process.env.VUE_APP_WEBSOCKET+username)
  },
  metaInfo() {
    return {
      title: this.$store.state.settings.dynamicTitle && this.$store.state.settings.title,
      titleTemplate: title => {
        return title ? `${title} - ${process.env.VUE_APP_TITLE}` : process.env.VUE_APP_TITLE
      }
    }
  }
};
</script>
<style scoped>
#app .theme-picker {
  display: none;
}
/deep/.dl-flex-column {
  display: flex;
  justify-content: start;
  align-items: center
}
/deep/.dl-flex-column-center {
  display: flex;
  justify-content: center;
  align-items: center
}
/deep/.dl-flex-column-center span{
  padding-left: 3px;
}
/deep/.custom-class th{
  background-color: rgba(240, 247, 255, 1) !important;
  font-size: 14px !important;
  color: rgba(41, 43, 45, 1) !important;
  border:none !important;
}
/deep/.custom-row-class td{
  border-bottom: 1px dashed rgba(218, 218, 218, 1);
}
</style>
