<template>
  <header class="header">
    <el-popconfirm @confirm="confirm" title="确定退出登录?">
      <template #reference>
        <el-button type="primary" link>退出登录</el-button>
      </template>
    </el-popconfirm>
  </header>
</template>

<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();
const confirm = () => {
  localStorage.setItem("token", "");
  localStorage.setItem("menu", "");
  router.replace({
    path: '/login',
  });
};
</script>

<style>
.header {
  text-align: right;
  height: 2em;
  line-height: 2em;
  padding-right: 1em;
  background-color: #393b48;
}
</style>
