style: format code

This commit is contained in:
misitebao 2021-11-15 03:07:00 +08:00
parent 63c2b04024
commit 96d2457b81
9 changed files with 69 additions and 71 deletions

View File

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html>
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />

View File

@ -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.
// 使aGo使
window.runtime.BrowserOpenURL(props.href)
}
window.runtime.BrowserOpenURL(props.href);
};
return {
onClickhandle
}
}
onClickhandle,
};
},
};
</script>

View File

@ -1,10 +1,10 @@
import OpenLink from '@/components/public/OpenLink.vue'
import OpenLink from "@/components/public/OpenLink.vue";
// Encapsulate global components as plug-ins
// 将全局组件封装为插件
export default {
install(app) {
app.component(OpenLink.name, OpenLink)
}
}
app.component(OpenLink.name, OpenLink);
},
};

View File

@ -1,17 +1,17 @@
import { createI18n } from 'vue-i18n'
import { createI18n } from "vue-i18n";
import zhHans from './messages/zh-Hans.json'
import en from './messages/en.json'
import fr from './messages/fr.json'
import zhHans from "./messages/zh-Hans.json";
import en from "./messages/en.json";
import fr from "./messages/fr.json";
const i18n = createI18n({
locale: "en",
fallbackLocale: 'en',
fallbackLocale: "en",
messages: {
"zh-Hans": zhHans,
"en": en,
"fr": fr
}
})
en: en,
fr: fr,
},
});
export default i18n
export default i18n;

View File

@ -1,14 +1,10 @@
import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
import i18n from '@/i18n'
import { createApp } from "vue";
import App from "./App.vue";
import router from "@/router";
import i18n from "@/i18n";
// Register global common components
// 注册全局通用组件
import publicComponents from '@/components/public'
import publicComponents from "@/components/public";
createApp(App)
.use(router)
.use(i18n)
.use(publicComponents)
.mount('#app')
createApp(App).use(router).use(i18n).use(publicComponents).mount("#app");

View File

@ -1,27 +1,27 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import Home from '@/views/Home.vue'
import { createRouter, createWebHashHistory } from "vue-router";
import Home from "@/views/Home.vue";
const routes = [
{
path: '/',
name: 'Home',
component: Home
path: "/",
name: "Home",
component: Home,
},
{
path: '/about',
name: 'About',
path: "/about",
name: "About",
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: function () {
return import(/* webpackChunkName: "about" */ '../views/About.vue')
}
}
]
return import(/* webpackChunkName: "about" */ "../views/About.vue");
},
},
];
const router = createRouter({
history: createWebHashHistory(),
routes
})
routes,
});
export default router
export default router;

View File

@ -1,7 +1,7 @@
<template>
<div class="about">
<!-- Title -->
<div class="title">{{ $t('aboutpage.title') }}</div>
<div class="title">{{ $t("aboutpage.title") }}</div>
<!-- Information -->
<!-- 信息 -->
<div class="content">
@ -10,40 +10,42 @@
</div>
<ul class="info">
<li class="info-item">
<div class="name">{{ $t('aboutpage.project-repository') }}</div>
<div class="name">{{ $t("aboutpage.project-repository") }}</div>
<OpenLink
class="link"
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 class="info-item">
<div class="name">{{ $t('aboutpage.wails-repository') }}</div>
<OpenLink
class="link"
href="https://github.com/wailsapp/wails"
>https://github.com/wailsapp/wails</OpenLink>
<div class="name">{{ $t("aboutpage.wails-repository") }}</div>
<OpenLink class="link" href="https://github.com/wailsapp/wails"
>https://github.com/wailsapp/wails</OpenLink
>
</li>
<li class="info-item">
<div class="name">{{ $t('aboutpage.author') }}</div>
<OpenLink class="link" href="https://github.com/misitebao">{{ $t('aboutpage.misitebao') }}</OpenLink>
<div class="name">{{ $t("aboutpage.author") }}</div>
<OpenLink class="link" href="https://github.com/misitebao">{{
$t("aboutpage.misitebao")
}}</OpenLink>
</li>
</ul>
</div>
<!-- Thanks -->
<!-- 谢语 -->
<div class="thank">{{ $t('aboutpage.thanks') }}</div>
<div class="thank">{{ $t("aboutpage.thanks") }}</div>
</div>
</template>
<script>
import comeonGif from '@/assets/images/comeon.gif'
import comeonGif from "@/assets/images/comeon.gif";
export default {
setup() {
return {
comeonGif
}
comeonGif,
};
},
}
};
</script>
<style lang="scss">
.about {

View File

@ -9,11 +9,13 @@
<OpenLink
href="https://wails.io/docs/gettingstarted/installation"
class="btn start"
>{{ $t('homepage.getting-started') }}</OpenLink>
>{{ $t("homepage.getting-started") }}</OpenLink
>
<OpenLink
href="https://github.com/misitebao/wails-template-vue"
class="btn star"
>{{ $t('homepage.star-me') }}</OpenLink>
>{{ $t("homepage.star-me") }}</OpenLink
>
</div>
</div>
</template>
@ -25,7 +27,7 @@ import HelloWorld from "@/components/HelloWorld.vue";
export default {
name: "Home",
components: {
HelloWorld
HelloWorld,
},
setup() {
return {};

View File

@ -1,13 +1,13 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
"@": path.resolve(__dirname, "src"),
},
},
build: {
@ -16,7 +16,7 @@ export default defineConfig({
entryFileNames: `assets/[name].js`,
chunkFileNames: `assets/[name].js`,
assetFileNames: `assets/[name].[ext]`,
}
},
}
})
},
},
});