LogOut.vue 986 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <template>
  2. <div class="logout">
  3. <el-button round @click="dialogVisible=true" style="border: 1px solid #ff3b30;color: #ff3b30;">退出登录</el-button>
  4. <el-dialog
  5. title="提示"
  6. :visible.sync="dialogVisible"
  7. width="30%"
  8. :before-close="handleClose">
  9. <span>确定永久退出登录?</span>
  10. <span slot="footer" class="dialog-footer">
  11. <el-button @click="dialogVisible = false">取 消</el-button>
  12. <el-button type="primary" @click="logout()">确 定</el-button>
  13. </span>
  14. </el-dialog>
  15. </div>
  16. </template>
  17. <script>
  18. export default {
  19. name: '',
  20. data () {
  21. return {
  22. dialogVisible:false
  23. };
  24. },
  25. computed: {
  26. },
  27. props: ['userInfo'],
  28. watch: {
  29. },
  30. methods: {
  31. aaa() {
  32. this.dialogVisible = true
  33. },
  34. logout() {
  35. this.$router.push('/')
  36. window.sessionStorage.clear()
  37. },
  38. handleClose() {
  39. this.dialogVisible = false
  40. }
  41. },
  42. };
  43. </script>
  44. <style scoped>
  45. </style>