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 {
|
export default {
|
||||||
setup({emails}){
|
setup({emails}){
|
||||||
let { emailSelection } = useEmailSelection();
|
let emailSelection = useEmailSelection();
|
||||||
|
|
||||||
let numberSelected = computed(() => {
|
let numberSelected = computed(() => {
|
||||||
return emailSelection.emails.size;
|
return emailSelection.emails.size;
|
||||||
|
|||||||
@@ -27,12 +27,11 @@
|
|||||||
let response = await axios.get('http://localhost:3000/emails');
|
let response = await axios.get('http://localhost:3000/emails');
|
||||||
let emails = response.data;
|
let emails = response.data;
|
||||||
let selectedScreen = 'archive';
|
let selectedScreen = 'archive';
|
||||||
let {emailSelection} = useEmailSelection();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
emails,
|
emails,
|
||||||
selectedScreen,
|
selectedScreen,
|
||||||
emailSelection
|
emailSelection: useEmailSelection()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -35,13 +35,10 @@
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
async setup(){
|
async setup(){
|
||||||
let openedEmail = null;
|
|
||||||
let { emailSelection } = useEmailSelection();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
format,
|
format,
|
||||||
openedEmail,
|
openedEmail: null,
|
||||||
emailSelection
|
emailSelection: useEmailSelection()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export const useEmailSelection = function(){
|
|||||||
moveToInbox(){ forSelected(e => e.archived = false); clear();}
|
moveToInbox(){ forSelected(e => e.archived = false); clear();}
|
||||||
}
|
}
|
||||||
|
|
||||||
return { emailSelection }
|
return emailSelection
|
||||||
}
|
}
|
||||||
|
|
||||||
export default useEmailSelection;
|
export default useEmailSelection;
|
||||||
Reference in New Issue
Block a user