<template>
  <el-button
    type="primary"
    size="mini"
    @click.prevent="handleMenuSelect('/videoList')"
    >视频列表</el-button
  >
  <el-button
    type="primary"
    size="mini"
    @click.prevent="handleMenuSelect('/device')"
    >设备管理</el-button
  >
  <el-button
    type="primary"
    size="mini"
    @click.prevent="handleMenuSelect('/User')"
    >用户</el-button
  >
  <el-button
    type="primary"
    size="mini"
    @click.prevent="handleMenuSelect('/chat')"
    >聊天</el-button
  >
  <el-button
    type="primary"
    size="mini"
    @click.prevent="handleMenuSelect('/group')"
    >群组</el-button
  >
  <el-button
    type="primary"
    size="mini"
    @click.prevent="handleMenuSelect('/cid')"
    >集成部署</el-button
  >
  <el-button type="primary" size="mini" class="el-button--danger" @click="logout()">退出登录</el-button>
</template>

<script>
export default {
  methods: {
    handleMenuSelect(path) {
      this.$router.push(path);
    },
    logout() {
      //询问是否退出登录
      if (!confirm("确定退出登录吗？")) {
        return;
      }
      //退出登录
      localStorage.clear();
      router.push("/login");
    },
  },
};
</script>
