ModalLogout.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <a-modal
  3. width="420px"
  4. :visible="showModal"
  5. @ok="handleOk"
  6. @cancel="handleCancel"
  7. :okText="$t('login.okBtn')"
  8. :cancelText="$t('login.cancelBtn')"
  9. unmountOnClose
  10. >
  11. <template #title><icon-exclamation-circle-fill class="tips-icon" /> {{ $t('login.tip') }} </template>
  12. <div>{{ $t('login.okText') }}</div>
  13. </a-modal>
  14. </template>
  15. <script setup>
  16. import { computed } from 'vue';
  17. // import { useRouter } from 'vue-router';
  18. // import { kuky_Authorization } from '../../../base/storage';
  19. // import { resetHasRouteFlag } from '../../../router';
  20. import useLogout from '../../account/use-logout';
  21. const props = defineProps({
  22. visible: {
  23. type: Boolean,
  24. default: false
  25. }
  26. });
  27. const emit = defineEmits(['update:visible']);
  28. // const router = useRouter();
  29. const showModal = computed(() => props.visible);
  30. const logout = useLogout();
  31. const handleOk = () => {
  32. logout();
  33. emit('update:visible', false);
  34. };
  35. const handleCancel = () => {
  36. emit('update:visible', false);
  37. };
  38. </script>
  39. <style scoped lang="css">
  40. .tips-icon {
  41. font-size: 20px;
  42. color: rgb(var(--orange-6));
  43. }
  44. </style>