mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-17 21:24:59 +00:00
30 lines
591 B
Vue
30 lines
591 B
Vue
<template>
|
|
<h1>VMail Inbox</h1>
|
|
|
|
Number selected: {{selectedEmailIds.size}}
|
|
|
|
<MailTable :emails="emails" />
|
|
</template>
|
|
|
|
<script>
|
|
import MailTable from '@/components/MailTable.vue';
|
|
import useEmailSelection from '../composition/useEmailSelection';
|
|
|
|
export default {
|
|
async setup(props, {attrs, slots}){
|
|
let response = await fetch('/api/emails');
|
|
let {emails} = await response.json();
|
|
|
|
let {selectedEmailIds} = useEmailSelection();
|
|
|
|
return {emails, selectedEmailIds}
|
|
},
|
|
components: {
|
|
MailTable
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style> |