-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
添加快捷键配置快速入口 #32
- Loading branch information
Showing
6 changed files
with
22,002 additions
and
8,046 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import config from './config' | ||
|
||
export default { | ||
autoSaveCopy (value = null) { | ||
if (value === null) { | ||
return config.getSetting('auto_save_copy', true) | ||
} | ||
return config.saveSetting('auto_save_copy', value) | ||
}, | ||
autoReadCopy (value = null) { | ||
if (value === null) { | ||
return config.getSetting('auto_read_copy', true) | ||
} | ||
return config.saveSetting('auto_read_copy', value) | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<template> | ||
<div> | ||
<CellGroup @on-click="open"> | ||
<Cell title="常用工具设置" name="setting"/> | ||
<Cell title="快捷键设置" name="shortcuts"/> | ||
</CellGroup> | ||
<CellGroup> | ||
<Cell title="自动复制结果到剪贴板"> | ||
<i-switch v-model="auto_save_copy" slot="extra"/> | ||
</Cell> | ||
<Cell title="自动读取剪贴板内容"> | ||
<i-switch v-model="auto_read_copy" slot="extra"/> | ||
</Cell> | ||
</CellGroup> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { openTab } from '../../helper' | ||
import setting from '../../tool/setting' | ||
export default { | ||
data () { | ||
return { | ||
auto_save_copy: true, | ||
auto_read_copy: true, | ||
} | ||
}, | ||
created () { | ||
this.auto_save_copy = setting.autoSaveCopy() | ||
this.auto_read_copy = setting.autoReadCopy() | ||
}, | ||
beforeDestroy () { | ||
setting.autoSaveCopy(this.auto_save_copy) | ||
setting.autoReadCopy(this.auto_read_copy) | ||
}, | ||
methods: { | ||
open (name) { | ||
console.log(name) | ||
switch (name) { | ||
case 'shortcuts': | ||
openTab('chrome://extensions/shortcuts') | ||
break | ||
case 'setting': | ||
openTab('/setting.html') | ||
break | ||
} | ||
}, | ||
}, | ||
} | ||
</script> |