-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a7ecbfb
commit 197be77
Showing
8 changed files
with
75 additions
and
23 deletions.
There are no files selected for viewing
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,34 @@ | ||
<script setup lang="ts"> | ||
import { VueButton, VueIcon } from '@vue/devtools-ui' | ||
async function opeInBrowser() { | ||
await trpc.openInBrowser.query(window.location.href) | ||
} | ||
async function openInClient() { | ||
await trpc.openInClient.query() | ||
} | ||
function refreshPage() { | ||
location.reload() | ||
} | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<div px3 py2 border="b base" flex="~ gap-2"> | ||
<VueButton outlined type="primary" @click="opeInBrowser"> | ||
<VueIcon icon="i-icon-park-outline:browser-safari" /> | ||
在浏览器打开 | ||
</VueButton> | ||
<VueButton outlined type="primary" @click="openInClient"> | ||
<VueIcon icon="i-material-symbols:desktop-windows-outline-sharp" /> | ||
在客户端打开 | ||
</VueButton> | ||
</div> | ||
<div px3 py2 flex="~ gap2"> | ||
<VueButton outlined type="primary" @click="refreshPage"> | ||
<VueIcon icon="i-lucide:refresh-cw" /> | ||
刷新页面 | ||
</VueButton> | ||
</div> | ||
</div> | ||
</template> |
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 |
---|---|---|
|
@@ -58,6 +58,9 @@ export default defineConfig({ | |
|
||
Components({ | ||
dts: true, | ||
dirs: [ | ||
'src/components', | ||
], | ||
}), | ||
|
||
UnoCSS(), | ||
|
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,23 @@ | ||
import { z } from 'zod' | ||
import { openInBrowser, openInDevtools, openInEditor } from '../../openCommands' | ||
import { publicProcedure, router } from './../trpc' | ||
import type { Options } from './../../types' | ||
|
||
export function OpenRouter(options?: Partial<Options>) { | ||
const { input, query } = publicProcedure | ||
|
||
return router({ | ||
openInEditor: input(z.string()).query((opts) => { | ||
openInEditor(opts.input, options?.launchEditor ?? 'code') | ||
}), | ||
openInBrowser: input(z.string()).query(async (opts) => { | ||
await openInBrowser(opts.input) | ||
|
||
return { success: true } | ||
}), | ||
openInClient: query(() => { | ||
console.log('openInClien') | ||
openInDevtools() | ||
}), | ||
}) | ||
} |
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