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 { 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;

View File

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

View File

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

View File

@@ -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;