mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-03-13 00:18:13 -04:00
Fixed: #189 || added change picbed button for upload page
This commit is contained in:
parent
d597477a79
commit
f87311760a
@ -3,7 +3,7 @@
|
|||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="20" :offset="2">
|
<el-col :span="20" :offset="2">
|
||||||
<div class="view-title">
|
<div class="view-title">
|
||||||
图片上传 - {{ picBedName }}
|
图片上传 - {{ picBedName }} <i class="el-icon-caret-bottom" @click="handleChangePicBed"></i>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
id="upload-area"
|
id="upload-area"
|
||||||
@ -66,7 +66,8 @@ export default {
|
|||||||
showError: false,
|
showError: false,
|
||||||
pasteStyle: '',
|
pasteStyle: '',
|
||||||
picBed: [],
|
picBed: [],
|
||||||
picBedName: ''
|
picBedName: '',
|
||||||
|
menu: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
@ -149,6 +150,25 @@ export default {
|
|||||||
getPicBeds (event, picBeds) {
|
getPicBeds (event, picBeds) {
|
||||||
this.picBed = picBeds
|
this.picBed = picBeds
|
||||||
this.getDefaultPicBed()
|
this.getDefaultPicBed()
|
||||||
|
},
|
||||||
|
handleChangePicBed () {
|
||||||
|
this.buildMenu()
|
||||||
|
this.menu.popup(this.$electron.remote.getCurrentWindow())
|
||||||
|
},
|
||||||
|
buildMenu () {
|
||||||
|
const _this = this
|
||||||
|
const submenu = this.picBed.map(item => {
|
||||||
|
return {
|
||||||
|
label: item.name,
|
||||||
|
type: 'radio',
|
||||||
|
checked: this.$db.read().get('picBed.current').value() === item.type,
|
||||||
|
click () {
|
||||||
|
_this.$db.read().set('picBed.current', item.type).write()
|
||||||
|
_this.$electron.ipcRenderer.send('syncPicBed')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.menu = this.$electron.remote.Menu.buildFromTemplate(submenu)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user