Skip to content

Commit

Permalink
docs: fix about & readme
Browse files Browse the repository at this point in the history
  • Loading branch information
AxyLm committed Sep 11, 2022
1 parent 37ac6c4 commit 77384d9
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 55 deletions.
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<br>
<br>
<br>
<h1 align='center'>Vite start</h1>
<br>
<br>
<br>
# vite-taicu

#### 跳过项目之始的配置环节,快速实现想法。`new FastifyIdea();`
![Website](https://img.shields.io/website?url=http%3A%2F%2Ftaicu.soulfree.cn)

<br>
一个 vite + vue3 开始模版。

特性
跳过项目之始的配置环节,快速实现想法。`new FastifyIdea();`

[演示](https://taicu.soulfree.cn/)

## 特性

- ⚡️ [Vue 3](https://github.com/vuejs/vue-next), [Vite](https://github.com/vitejs/vite), [TypeScript](https://www.typescriptlang.org/zh/) Yes!
- 🍍 [使用 Pinia 的状态管理](https://pinia.esm.dev/)
Expand All @@ -20,8 +18,6 @@
- 🛠 [VueUse](https://github.com/antfu/vueuse) - Vue CompositionApi 的集合
- [Eslint](http://eslint.cn/) + [prettier](https://prettier.io/) + [husky](https://typicode.github.io/husky/#/) 自动格式化...

<br>

## 使用

### 开发
Expand All @@ -42,6 +38,17 @@ yarn build
yarn prettier
```

### 自动部署 git pages

Go to [GitHub Pages](https://github.com/AxyLm/vite-taicu/settings/pages)

1. Under "Build and deployment", under "Source", select **Deploy from a branch**.
2. Under "Build and deployment", under "Branch", select **gh-pages**

- This option can be modified in [action.yml](./.github/workflows/action.yml#L35) on line 35

3. Click **Save**.

## 来自

- [Vitesse](https://github.com/antfu/vitesse.git) - [@antfu](https://github.com/antfu)
Expand All @@ -58,6 +65,6 @@ yarn prettier
| 仲冬之月 | 律中黄钟 |
| 季冬之月 | 律中大吕 |

😜
## LICENSE

<br>
[MIT license](./LICENSE)
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vite-taicu",
"version": "1.0",
"version": "1.1",
"private": false,
"description": "一个vite开发模版(vue3,pinia,ts,eslint,prettier,lint-staged)",
"keywords": [
Expand All @@ -11,7 +11,7 @@
"typescript",
"prettier"
],
"homepage": "https://github.com/AxyLm/vite-taicu",
"homepage": "https://taicu.soulfree.cn/",
"repository": {
"type": "git",
"url": "https://github.com/AxyLm/vite-taicu"
Expand Down
12 changes: 0 additions & 12 deletions src/composables/i18n.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
import { useI18n as i18n } from 'vue-i18n';

// export const toggleLocale = (locale?: string) => {
// const { availableLocales, locale: currentLocal } = useI18n();
// // change to some real logic
// const locales = availableLocales;
// currentLocal.value = locale || locales[(locales.indexOf(currentLocal.value) + 1) % locales.length];
// };

// export const changeLocale = (locale: string) => {
// const { availableLocales, locale: currentLocal } = useI18n();
// currentLocal.value = locale;
// };

export function useI18n() {
const { availableLocales, locale: currentLocal } = i18n();

Expand Down
22 changes: 2 additions & 20 deletions src/layout/index.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
<template>
<div class="layout">
<LayoutHeader />
<div class="p-20 text-center">
<img src="/src/assets/logo.svg" class="mb-20 inline w-60" alt="" />
<div class="px-4 pl-8 text-center sm:px-20">
<img src="/src/assets/logo.svg" class="mb-10 mt-8 inline w-48" alt="" />
<div>
<router-view></router-view>
</div>
</div>
<LayoutFooter />
</div>
</template>
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
</script>
<script lang="ts">
import LayoutHeader from './header.vue';
import LayoutFooter from './footer.vue';
Expand All @@ -27,17 +23,3 @@
},
});
</script>

<style lang="less">
.wrap {
height: 100vh;
}
.fm1 {
font-family: 'Josefin Sans', sans-serif;
}
.fm2 {
font-family: sans-serif;
}
</style>
6 changes: 3 additions & 3 deletions src/modules/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { type App } from 'vue';

// Import i18n resources
// https://vitejs.dev/guide/features.html#glob-import
//
// Don't need this? Try vitesse-lite: https://github.com/antfu/vitesse-lite

const messages = Object.fromEntries(
Object.entries(import.meta.globEager('../../locales/*.y(a)?ml')).map(([key, value]) => {
const yaml = key.endsWith('.yaml');
Expand All @@ -14,10 +13,11 @@ const messages = Object.fromEntries(

export const install = (app: App<Element>) => {
const i18n = createI18n({
// legacy: true,
locale: 'en',
fallbackLocale: 'en',
messages,
});

app.config.globalProperties.$t = i18n.global.t;
app.use(i18n);
};
2 changes: 1 addition & 1 deletion src/modules/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export { routes };
export const install = (app: App<Element>) => {
const router = createRouter({
routes,
history: createWebHistory(),
history: createWebHistory(import.meta.env.BASE_URL ?? '/'),
});
router.beforeEach(beforeEach);

Expand Down
6 changes: 3 additions & 3 deletions tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ const colors = require('tailwindcss/colors');

module.exports = {
mode: 'jit',
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'], // build时删除未使用的类名
safelist: ['bg-blue-500', 'text-center', 'hover:opacity-100', 'lg:text-right'], // 将特定类列入安全列表 (no delete)
darkMode: 'class', // or 'media' or 'class'
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
safelist: ['bg-blue-500', 'text-center', 'hover:opacity-100', 'lg:text-right'],
darkMode: 'class',
theme: {
extend: {
boxShadow: ['dark'],
Expand Down

0 comments on commit 77384d9

Please sign in to comment.