mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 15:25:59 +00:00
app menu definition in JSON
This commit is contained in:
@@ -1,25 +1,18 @@
|
||||
<script lang="ts">
|
||||
import getElectron from '../utility/getElectron';
|
||||
import { openWebLink } from '../utility/exportElectronFile';
|
||||
|
||||
export let href = undefined;
|
||||
export let onClick = undefined;
|
||||
|
||||
const electron = getElectron();
|
||||
</script>
|
||||
|
||||
{#if onClick}
|
||||
<a on:click={onClick}>
|
||||
<slot />
|
||||
</a>
|
||||
{:else if electron}
|
||||
<a on:click={() => electron.shell.openExternal(href)}>
|
||||
<slot />
|
||||
</a>
|
||||
{:else}
|
||||
<a {href} target="_blank" rel="noopener noreferrer">
|
||||
<slot />
|
||||
</a>
|
||||
{/if}
|
||||
<a
|
||||
on:click={() => {
|
||||
if (onClick) onClick();
|
||||
else openWebLink(href);
|
||||
}}
|
||||
>
|
||||
<slot />
|
||||
</a>
|
||||
|
||||
<style>
|
||||
a {
|
||||
|
||||
Reference in New Issue
Block a user