Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
oeyoews committed Mar 22, 2024
1 parent 7b757f5 commit 3d01876
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ This template should help get you started developing with Vue 3 in WXT.

- [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).

* element plus, tailwindcss, wxt, vue
* element plus, tailwindcss, wxt, vue, axios

## TODO

* extension icon
* 统计大小
* darkmode
* 支持保存到 tiddlywiki
* 支持保存到 github
* 右键菜单
* 右键菜单实现功能,快捷键提示
* 日记模式
* codemirror6
* 代码拆分组件
Expand Down
21 changes: 21 additions & 0 deletions entrypoints/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,25 @@ export default defineBackground(() => {
active: true,
});
});

chrome.runtime.onInstalled.addListener(function () {
chrome.contextMenus.create({
id: 'tiddlywiki',
title: '添加到 TiddlyWiki(Ctrl+Shift+F)',
contexts: ['all'],
});
});

chrome.commands.onCommand.addListener(function (command) {
if (command === 'addtiddlywiki') {
console.log('yu ');
// 处理快捷键被触发时的逻辑
}
});

chrome.contextMenus.onClicked.addListener(function (info, tab) {
if (info.menuItemId === 'tiddlywiki') {
// 处理右键菜单点击事件的逻辑
}
});
});
2 changes: 0 additions & 2 deletions entrypoints/popup/Popup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import FaRegularEdit from '~icons/fa-regular/edit';
import FaFileTextO from '~icons/fa/file-text-o';
// @ts-ignore
import FaRegularSave from '~icons/fa-regular/save';
import { ElMessage, ElNotification } from 'element-plus'
import { ref, } from 'vue';
import saveMarkdown from '@/utils/saveMarkdown'
import { html2md, md2html } from '@/utils/parser'
Expand Down Expand Up @@ -88,7 +87,6 @@ watch(md, async () => {
spellcheck="false" class="w-full" />
</ElTabPane>


</ElTabs>

</div>
Expand Down
10 changes: 10 additions & 0 deletions wxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,17 @@ export default defineConfig({
],
}),
manifest: {
commands: {
addtiddlywiki: {
suggested_key: {
default: 'Ctrl+Shift+F',
mac: 'MacCtrl+Shift+F',
},
description: '执行我的命令',
},
},
permissions: [
'contextMenus',
'alarms',
'activeTab',
'contextMenus',
Expand Down

0 comments on commit 3d01876

Please sign in to comment.