Added: autoStart

This commit is contained in:
Molunerfinn 2018-05-02 17:17:55 +08:00
parent 282b0dc25c
commit eaa348ad56
2 changed files with 8 additions and 1 deletions

View File

@ -470,6 +470,10 @@ app.on('will-quit', () => {
globalShortcut.unregisterAll() globalShortcut.unregisterAll()
}) })
app.setLoginItemSettings({
openAtLogin: db.read().get('picBed.autoStart').value() || false
})
/** /**
* Auto Updater * Auto Updater
* *

View File

@ -38,6 +38,7 @@
v-model="form.autoStart" v-model="form.autoStart"
active-text="开" active-text="开"
inactive-text="关" inactive-text="关"
@change="handleAutoStartChange"
></el-switch> ></el-switch>
</el-form-item> </el-form-item>
<el-form-item <el-form-item
@ -164,7 +165,6 @@ export default {
return item.name return item.name
} }
}) })
console.log(this.picBed)
}, },
methods: { methods: {
keyDetect (type, event) { keyDetect (type, event) {
@ -208,6 +208,9 @@ export default {
return item return item
}) })
this.$db.read().set('picBed.list', list).write() this.$db.read().set('picBed.list', list).write()
},
handleAutoStartChange (val) {
this.$db.read().set('picBed.autoStart', val).write()
} }
} }
} }