mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-11 18:54:31 +00:00
Update emailSelection export and usage to Evan-recommended "module style" syntax
This commit is contained in:
@@ -30,7 +30,7 @@
|
||||
|
||||
export default {
|
||||
setup({emails}){
|
||||
let { emailSelection } = useEmailSelection();
|
||||
let emailSelection = useEmailSelection();
|
||||
|
||||
let numberSelected = computed(() => {
|
||||
return emailSelection.emails.size;
|
||||
|
||||
@@ -27,12 +27,11 @@
|
||||
let response = await axios.get('http://localhost:3000/emails');
|
||||
let emails = response.data;
|
||||
let selectedScreen = 'archive';
|
||||
let {emailSelection} = useEmailSelection();
|
||||
|
||||
return {
|
||||
emails,
|
||||
selectedScreen,
|
||||
emailSelection
|
||||
emailSelection: useEmailSelection()
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
||||
@@ -35,13 +35,10 @@
|
||||
|
||||
export default {
|
||||
async setup(){
|
||||
let openedEmail = null;
|
||||
let { emailSelection } = useEmailSelection();
|
||||
|
||||
return {
|
||||
format,
|
||||
openedEmail,
|
||||
emailSelection
|
||||
openedEmail: null,
|
||||
emailSelection: useEmailSelection()
|
||||
}
|
||||
},
|
||||
components: {
|
||||
|
||||
@@ -35,7 +35,7 @@ export const useEmailSelection = function(){
|
||||
moveToInbox(){ forSelected(e => e.archived = false); clear();}
|
||||
}
|
||||
|
||||
return { emailSelection }
|
||||
return emailSelection
|
||||
}
|
||||
|
||||
export default useEmailSelection;
|
||||
Reference in New Issue
Block a user