Added: picgo plugin handle states

This commit is contained in:
Molunerfinn
2018-12-18 18:58:31 +08:00
parent 72f2669cce
commit be6cce9501
14 changed files with 175 additions and 131 deletions

View File

@@ -0,0 +1,22 @@
import db from '~/datastore'
export default {
name: '',
data () {
return {
defaultPicBed: db.read().get('picBed.current').value()
}
},
methods: {
setDefaultPicBed (type) {
db.read().set('picBed.current', type).write()
this.defaultPicBed = type
this.$electron.ipcRenderer.send('updateDefaultPicBed', type)
const successNotification = new window.Notification('设置默认图床', {
body: '设置成功'
})
successNotification.onclick = () => {
return true
}
}
}
}

View File

@@ -1,13 +1,7 @@
import db from '~/datastore'
export default {
mounted () {
this.disableDragEvent()
},
data () {
return {
defaultPicBed: db.read().get('picBed.current').value()
}
},
methods: {
disableDragEvent () {
window.addEventListener('dragenter', this.disableDrag, false)
@@ -21,17 +15,6 @@ export default {
e.dataTransfer.effectAllowed = 'none'
e.dataTransfer.dropEffect = 'none'
}
},
setDefaultPicBed (type) {
db.read().set('picBed.current', type).write()
this.defaultPicBed = type
this.$electron.ipcRenderer.send('updateDefaultPicBed', type)
const successNotification = new window.Notification('设置默认图床', {
body: '设置成功'
})
successNotification.onclick = () => {
return true
}
}
},
beforeDestroy () {