export default {
  name: "Header",
  data() {
    return {
      fullscreen: false
    };
  },
  computed: {
    username() {
      return this.$store.state.status.username;
    }
  },
  methods: {
    handleCommand(command) {
      if (command === "logout") {
        logout().then(() => {
          this.$store.commit("logout");
          this.$message.success("注销成功");
          this.$router.push("/login");
        });
      }
    },
    handleFullScreen() {
      let element = document.documentElement;
      if (this.fullscreen) {
        if (document.exitFullscreen) {
          document.exitFullscreen();
        } else if (document.webkitCancelFullScreen) {
          document.webkitCancelFullScreen();
        } else if (document.mozCancelFullScreen) {
          document.mozCancelFullScreen();
        } else if (document.msExitFullscreen) {
          document.msExitFullscreen();
        }
      } else {
        if (element.requestFullscreen) {
          element.requestFullscreen();
        } else if (element.webkitRequestFullScreen) {
          element.webkitRequestFullScreen();
        } else if (element.mozRequestFullScreen) {
          element.mozRequestFullScreen();
        } else if (element.msRequestFullscreen) {
          // IE11
          element.msRequestFullscreen();
        }
      }
      this.fullscreen = !this.fullscreen;
    }
  }
};啥意思