mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-18 05:25:08 +00:00
Moved "number selected"... but it doesn't update. Why?
This commit is contained in:
@@ -1,18 +1,23 @@
|
||||
<template>
|
||||
<h1>VMail Inbox</h1>
|
||||
|
||||
Number selected: {{selectedEmailIds.size}}
|
||||
|
||||
<MailTable :emails="emails" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MailTable from '@/components/MailTable.vue';
|
||||
import { ref } from 'vue';
|
||||
import useEmailSelection from '../composition/useEmailSelection';
|
||||
|
||||
export default {
|
||||
async setup(props, {attrs, slots}){
|
||||
let response = await fetch('/api/emails');
|
||||
let {emails} = await response.json();
|
||||
|
||||
return {emails}
|
||||
let {selectedEmailIds} = useEmailSelection();
|
||||
|
||||
return {emails, selectedEmailIds}
|
||||
},
|
||||
components: {
|
||||
MailTable
|
||||
|
||||
Reference in New Issue
Block a user