Update emailSelection export and usage to Evan-recommended "module style" syntax

This commit is contained in:
Jeffrey Biles
2020-04-14 06:09:36 -07:00
parent 25c6c3ad22
commit c58f792d7e
4 changed files with 5 additions and 9 deletions

View File

@@ -30,7 +30,7 @@
export default {
setup({emails}){
let { emailSelection } = useEmailSelection();
let emailSelection = useEmailSelection();
let numberSelected = computed(() => {
return emailSelection.emails.size;

View File

@@ -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: {

View File

@@ -35,13 +35,10 @@
export default {
async setup(){
let openedEmail = null;
let { emailSelection } = useEmailSelection();
return {
format,
openedEmail,
emailSelection
openedEmail: null,
emailSelection: useEmailSelection()
}
},
components: {

View File

@@ -35,7 +35,7 @@ export const useEmailSelection = function(){
moveToInbox(){ forSelected(e => e.archived = false); clear();}
}
return { emailSelection }
return emailSelection
}
export default useEmailSelection;