mirror of
https://github.com/misitebao/wails-template-vue
synced 2025-05-11 17:48:01 +08:00
style: format code
This commit is contained in:
parent
63c2b04024
commit
96d2457b81
@ -1,5 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<link rel="icon" href="/favicon.ico" />
|
<link rel="icon" href="/favicon.ico" />
|
||||||
|
@ -16,15 +16,13 @@ export default {
|
|||||||
// You cannot use the a tag directly, you need to call the Go method here to open the link using the default browser.
|
// You cannot use the a tag directly, you need to call the Go method here to open the link using the default browser.
|
||||||
// 不能直接使用a标签,需要在这里调用Go方法以使用默认浏览器打开链接。
|
// 不能直接使用a标签,需要在这里调用Go方法以使用默认浏览器打开链接。
|
||||||
|
|
||||||
window.runtime.BrowserOpenURL(props.href)
|
window.runtime.BrowserOpenURL(props.href);
|
||||||
|
};
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
onClickhandle
|
onClickhandle,
|
||||||
}
|
};
|
||||||
}
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import OpenLink from '@/components/public/OpenLink.vue'
|
import OpenLink from "@/components/public/OpenLink.vue";
|
||||||
|
|
||||||
// Encapsulate global components as plug-ins
|
// Encapsulate global components as plug-ins
|
||||||
// 将全局组件封装为插件
|
// 将全局组件封装为插件
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
install(app) {
|
install(app) {
|
||||||
app.component(OpenLink.name, OpenLink)
|
app.component(OpenLink.name, OpenLink);
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
import { createI18n } from 'vue-i18n'
|
import { createI18n } from "vue-i18n";
|
||||||
|
|
||||||
import zhHans from './messages/zh-Hans.json'
|
import zhHans from "./messages/zh-Hans.json";
|
||||||
import en from './messages/en.json'
|
import en from "./messages/en.json";
|
||||||
import fr from './messages/fr.json'
|
import fr from "./messages/fr.json";
|
||||||
|
|
||||||
const i18n = createI18n({
|
const i18n = createI18n({
|
||||||
locale: "en",
|
locale: "en",
|
||||||
fallbackLocale: 'en',
|
fallbackLocale: "en",
|
||||||
messages: {
|
messages: {
|
||||||
"zh-Hans": zhHans,
|
"zh-Hans": zhHans,
|
||||||
"en": en,
|
en: en,
|
||||||
"fr": fr
|
fr: fr,
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
|
||||||
export default i18n
|
export default i18n;
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
import { createApp } from 'vue'
|
import { createApp } from "vue";
|
||||||
import App from './App.vue'
|
import App from "./App.vue";
|
||||||
import router from '@/router'
|
import router from "@/router";
|
||||||
import i18n from '@/i18n'
|
import i18n from "@/i18n";
|
||||||
|
|
||||||
// Register global common components
|
// Register global common components
|
||||||
// 注册全局通用组件
|
// 注册全局通用组件
|
||||||
import publicComponents from '@/components/public'
|
import publicComponents from "@/components/public";
|
||||||
|
|
||||||
createApp(App)
|
createApp(App).use(router).use(i18n).use(publicComponents).mount("#app");
|
||||||
.use(router)
|
|
||||||
.use(i18n)
|
|
||||||
.use(publicComponents)
|
|
||||||
.mount('#app')
|
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
import { createRouter, createWebHashHistory } from 'vue-router'
|
import { createRouter, createWebHashHistory } from "vue-router";
|
||||||
import Home from '@/views/Home.vue'
|
import Home from "@/views/Home.vue";
|
||||||
|
|
||||||
const routes = [
|
const routes = [
|
||||||
{
|
{
|
||||||
path: '/',
|
path: "/",
|
||||||
name: 'Home',
|
name: "Home",
|
||||||
component: Home
|
component: Home,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/about',
|
path: "/about",
|
||||||
name: 'About',
|
name: "About",
|
||||||
// route level code-splitting
|
// route level code-splitting
|
||||||
// this generates a separate chunk (about.[hash].js) for this route
|
// this generates a separate chunk (about.[hash].js) for this route
|
||||||
// which is lazy-loaded when the route is visited.
|
// which is lazy-loaded when the route is visited.
|
||||||
component: function () {
|
component: function () {
|
||||||
return import(/* webpackChunkName: "about" */ '../views/About.vue')
|
return import(/* webpackChunkName: "about" */ "../views/About.vue");
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]
|
];
|
||||||
|
|
||||||
const router = createRouter({
|
const router = createRouter({
|
||||||
history: createWebHashHistory(),
|
history: createWebHashHistory(),
|
||||||
routes
|
routes,
|
||||||
})
|
});
|
||||||
|
|
||||||
export default router
|
export default router;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="about">
|
<div class="about">
|
||||||
<!-- Title -->
|
<!-- Title -->
|
||||||
<div class="title">{{ $t('aboutpage.title') }}</div>
|
<div class="title">{{ $t("aboutpage.title") }}</div>
|
||||||
<!-- Information -->
|
<!-- Information -->
|
||||||
<!-- 信息 -->
|
<!-- 信息 -->
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@ -10,40 +10,42 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul class="info">
|
<ul class="info">
|
||||||
<li class="info-item">
|
<li class="info-item">
|
||||||
<div class="name">{{ $t('aboutpage.project-repository') }}</div>
|
<div class="name">{{ $t("aboutpage.project-repository") }}</div>
|
||||||
<OpenLink
|
<OpenLink
|
||||||
class="link"
|
class="link"
|
||||||
href="https://github.com/misitebao/wails-template-vue"
|
href="https://github.com/misitebao/wails-template-vue"
|
||||||
>https://github.com/misitebao/wails-template-vue</OpenLink>
|
>https://github.com/misitebao/wails-template-vue</OpenLink
|
||||||
|
>
|
||||||
</li>
|
</li>
|
||||||
<li class="info-item">
|
<li class="info-item">
|
||||||
<div class="name">{{ $t('aboutpage.wails-repository') }}</div>
|
<div class="name">{{ $t("aboutpage.wails-repository") }}</div>
|
||||||
<OpenLink
|
<OpenLink class="link" href="https://github.com/wailsapp/wails"
|
||||||
class="link"
|
>https://github.com/wailsapp/wails</OpenLink
|
||||||
href="https://github.com/wailsapp/wails"
|
>
|
||||||
>https://github.com/wailsapp/wails</OpenLink>
|
|
||||||
</li>
|
</li>
|
||||||
<li class="info-item">
|
<li class="info-item">
|
||||||
<div class="name">{{ $t('aboutpage.author') }}</div>
|
<div class="name">{{ $t("aboutpage.author") }}</div>
|
||||||
<OpenLink class="link" href="https://github.com/misitebao">{{ $t('aboutpage.misitebao') }}</OpenLink>
|
<OpenLink class="link" href="https://github.com/misitebao">{{
|
||||||
|
$t("aboutpage.misitebao")
|
||||||
|
}}</OpenLink>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Thanks -->
|
<!-- Thanks -->
|
||||||
<!-- 谢语 -->
|
<!-- 谢语 -->
|
||||||
<div class="thank">{{ $t('aboutpage.thanks') }}</div>
|
<div class="thank">{{ $t("aboutpage.thanks") }}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import comeonGif from '@/assets/images/comeon.gif'
|
import comeonGif from "@/assets/images/comeon.gif";
|
||||||
export default {
|
export default {
|
||||||
setup() {
|
setup() {
|
||||||
return {
|
return {
|
||||||
comeonGif
|
comeonGif,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.about {
|
.about {
|
||||||
|
@ -9,11 +9,13 @@
|
|||||||
<OpenLink
|
<OpenLink
|
||||||
href="https://wails.io/docs/gettingstarted/installation"
|
href="https://wails.io/docs/gettingstarted/installation"
|
||||||
class="btn start"
|
class="btn start"
|
||||||
>{{ $t('homepage.getting-started') }}</OpenLink>
|
>{{ $t("homepage.getting-started") }}</OpenLink
|
||||||
|
>
|
||||||
<OpenLink
|
<OpenLink
|
||||||
href="https://github.com/misitebao/wails-template-vue"
|
href="https://github.com/misitebao/wails-template-vue"
|
||||||
class="btn star"
|
class="btn star"
|
||||||
>{{ $t('homepage.star-me') }}</OpenLink>
|
>{{ $t("homepage.star-me") }}</OpenLink
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -25,7 +27,7 @@ import HelloWorld from "@/components/HelloWorld.vue";
|
|||||||
export default {
|
export default {
|
||||||
name: "Home",
|
name: "Home",
|
||||||
components: {
|
components: {
|
||||||
HelloWorld
|
HelloWorld,
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
return {};
|
return {};
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from "vite";
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from "@vitejs/plugin-vue";
|
||||||
import path from 'path'
|
import path from "path";
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, 'src')
|
"@": path.resolve(__dirname, "src"),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
@ -16,7 +16,7 @@ export default defineConfig({
|
|||||||
entryFileNames: `assets/[name].js`,
|
entryFileNames: `assets/[name].js`,
|
||||||
chunkFileNames: `assets/[name].js`,
|
chunkFileNames: `assets/[name].js`,
|
||||||
assetFileNames: `assets/[name].[ext]`,
|
assetFileNames: `assets/[name].[ext]`,
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
})
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user