Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
axiangcoding committed Jul 1, 2024
1 parent 86dfeeb commit 4e1968d
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 14 deletions.
36 changes: 25 additions & 11 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ onMounted(async () => {
appVersion.value = await getVersion();
});
async function jumpToBiliBili() {
await open("https://space.bilibili.com/8696650");
async function jumpTo(url: string) {
await open(url);
}
async function jumpToGithub() {
Expand All @@ -68,31 +68,45 @@ async function jumpToGithub() {
</template>

<v-app-bar-title>
战雷工具箱
{{ $t("app.title") }}
<v-chip color="green" variant="flat" rounded>
v{{ appVersion }}
</v-chip>
</v-app-bar-title>

<template v-slot:append>
<v-btn prepend-icon="mdi-heart" @click="jumpToBiliBili">
<template v-slot:prepend>
<v-icon color="red"></v-icon>
</template>
关注作者 - 摸鱼又开摆的三三
</v-btn>
<v-btn prepend-icon="mdi-bug" @click="feedbackDialog = true">
<template v-slot:prepend>
<v-icon></v-icon>
</template>
反馈问题
{{ $t("app.report_bug") }}
</v-btn>
<v-btn prepend-icon="mdi-github" @click="jumpToGithub">
<template v-slot:prepend>
<v-icon></v-icon>
</template>
开源项目
{{ $t("app.github") }}
</v-btn>

<v-menu open-on-hover>
<template v-slot:activator="{ props }">
<v-btn v-bind="props" prepend-icon="mdi-account-group">
{{ $t("app.follow") }}
</v-btn>
</template>

<v-list>
<v-list-item
v-for="(item, index) in $tm('app.follow_links') as any[]"
:key="index"
:value="index"
append-icon="mdi-open-in-new"
@click="jumpTo(item.url)"
>
{{ item.text }}
</v-list-item>
</v-list>
</v-menu>
</template>
</v-app-bar>

Expand Down
16 changes: 16 additions & 0 deletions src/i18n.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import en from "./locales/en.json";
import zh from "./locales/zh.json";

import { createI18n } from "vue-i18n";

const i18n = createI18n({
legacy: false,
locale: "en",
fallbackLocale: "en",
messages: {
en,
zh,
},
});

export default i18n;
14 changes: 14 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"app": {
"title": "WT Toolkit",
"follow": "Follow author on",
"report_bug": "Report a bug",
"github": "GitHub",
"follow_links": [
{
"text": "BiliBili",
"url": "https://space.bilibili.com/8696650"
}
]
}
}
1 change: 1 addition & 0 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import router from "./router";
// Components
import App from "./App.vue";
import { md3 } from "vuetify/blueprints";
import { createI18n } from "vue-i18n";
import i18n from "./i18n";


const vuetify = createVuetify({ blueprint: md3 });

const i18n = createI18n({});
const vuetify = createVuetify({ blueprint: md3 });

const app = createApp(App);

Expand Down

0 comments on commit 4e1968d

Please sign in to comment.