mirror of
https://github.com/kevin-DL/build-gmail-clone-with-vue-3.git
synced 2026-01-17 13:14:54 +00:00
Mark read and unread
This commit is contained in:
@@ -5,12 +5,22 @@ export const useEmailSelection = function(){
|
||||
|
||||
let emailSelection = reactive({
|
||||
emails: emails,
|
||||
toggle: function(id) {
|
||||
toggle(id) {
|
||||
if(this.emails.has(id)) {
|
||||
this.emails.delete(id)
|
||||
} else {
|
||||
this.emails.add(id);
|
||||
}
|
||||
},
|
||||
markRead(){
|
||||
this.emails.forEach(email => {
|
||||
email.read = true
|
||||
})
|
||||
},
|
||||
markUnread(){
|
||||
this.emails.forEach(email => {
|
||||
email.read = false
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user