mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-24 07:55:34 +00:00
This fixes the "archived emails stick around" issue... but I want to be able to do it with the setup function
This commit is contained in:
@@ -47,15 +47,16 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let changeEmail = function({amount, archive}){
|
return {format, emailSelection, openedEmail, openEmail}
|
||||||
let index = emails.findIndex(e => e == openedEmail.value);
|
},
|
||||||
|
methods: {
|
||||||
|
changeEmail({amount, archive}) {
|
||||||
|
let index = this.emails.findIndex(e => e == this.openedEmail);
|
||||||
|
|
||||||
if(archive) { emails[index].archived = true }
|
if(archive) { this.emails[index].archived = true }
|
||||||
|
|
||||||
openEmail(emails[index + amount])
|
this.openEmail(this.emails[index + amount])
|
||||||
}
|
}
|
||||||
|
|
||||||
return {format, emailSelection, openedEmail, openEmail, changeEmail}
|
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
emails: {
|
emails: {
|
||||||
|
|||||||
Reference in New Issue
Block a user