mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-07-27 00:38:20 +08:00
Added: picgo plugin handle states
This commit is contained in:
22
src/renderer/utils/ConfirmButtonMixin.js
Normal file
22
src/renderer/utils/ConfirmButtonMixin.js
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user