mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-09-07 16:37:04 +08:00
feat: all mail use MailBox Component (#173)
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
<script setup>
|
||||
import MailBox from './MailBox.vue';
|
||||
import MailBox from '../components/MailBox.vue';
|
||||
import { useGlobalState } from '../store'
|
||||
const { settings } = useGlobalState()
|
||||
import { api } from '../api'
|
||||
|
||||
const { settings, openSettings } = useGlobalState()
|
||||
|
||||
const fetchMailData = async (limit, offset) => {
|
||||
return await api.fetch(`/api/mails?limit=${limit}&offset=${offset}`);
|
||||
};
|
||||
|
||||
const deleteMail = async (curMailId) => {
|
||||
await api.fetch(`/api/mails/${curMailId}`, { method: 'DELETE' });
|
||||
};
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<MailBox v-if="settings.address" />
|
||||
<div v-if="settings.address">
|
||||
<MailBox :showEMailTo="false" :enableUserDeleteEmail="openSettings.enableUserDeleteEmail"
|
||||
:fetchMailData="fetchMailData" :deleteMail="deleteMail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user