Skip to content

Commit

Permalink
Merge pull request #164 from chengpeiquan/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
chengpeiquan authored Oct 10, 2021
2 parents 8c7bbb8 + 6a82d42 commit a36b3e5
Show file tree
Hide file tree
Showing 21 changed files with 119 additions and 120 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
max_line_length = 80
trim_trailing_whitespace = true

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { computed, provide, ref, watchEffect } from 'vue'
import { useHead } from '@vueuse/head'
import { useRoute } from 'vue-router'
import config from '/@/config'
import config from '@/config'
import { get } from '@vueuse/core'
const route = useRoute()
Expand Down
4 changes: 2 additions & 2 deletions src/components/ChildrenList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import isDev from '/@libs/isDev'
import isMobile from '/@libs/isMobile'
import isDev from '@libs/isDev'
import isMobile from '@libs/isMobile'
interface Children {
id?: number
Expand Down
4 changes: 2 additions & 2 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@

<script setup lang="ts">
import { ref, inject, watchEffect } from 'vue'
import config from '/@/config'
import isMobile from '/@libs/isMobile'
import config from '@/config'
import isMobile from '@libs/isMobile'
const name = ref<string>('')
const icp = ref<string>('')
Expand Down
6 changes: 3 additions & 3 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@
<script setup lang="ts">
import { ref, inject, watchEffect } from 'vue'
import { useRouter } from 'vue-router'
import isDark from '/@libs/isDark'
import isMobile from '/@libs/isMobile'
import config from '/@/config'
import isDark from '@libs/isDark'
import isMobile from '@libs/isMobile'
import config from '@/config'
interface NavList {
path: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/ToggleTheme.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<script setup lang="ts">
import { inject } from 'vue'
import isDark from '/@libs/isDark'
import isDark from '@libs/isDark'
const lang: string = inject('lang') || ''
Expand Down
6 changes: 3 additions & 3 deletions src/components/blog/Article.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ import { onMounted, ref, inject, computed } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { isClient } from '@vueuse/core'
import { useHead } from '@vueuse/head'
import config from '/@/config'
import dateDisplay from '/@libs/dateDisplay'
import isMobile from '/@libs/isMobile'
import config from '@/config'
import dateDisplay from '@libs/dateDisplay'
import isMobile from '@libs/isMobile'
const route = useRoute()
const router = useRouter()
Expand Down
2 changes: 1 addition & 1 deletion src/components/blog/Detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<script setup lang="ts">
import { useRoute } from 'vue-router'
import isArticle from '/@libs/isArticle'
import isArticle from '@libs/isArticle'
const route = useRoute()
const isUseArticle = isArticle(route)
Expand Down
10 changes: 5 additions & 5 deletions src/components/blog/List.vue
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@
import { reactive, ref, inject } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import type { RouteRecordRaw } from 'vue-router'
import { categories } from '/@/router/categories'
import isArticle from '/@libs/isArticle'
import { useHead } from '@vueuse/head'
import config from '/@/config'
import dateDisplay from '/@libs/dateDisplay'
import isDev from '/@libs/isDev'
import { categories } from '@/router/categories'
import isArticle from '@libs/isArticle'
import config from '@/config'
import dateDisplay from '@libs/dateDisplay'
import isDev from '@libs/isDev'
interface List {
path: string
Expand Down
2 changes: 1 addition & 1 deletion src/components/blog/Page.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<script setup lang="ts">
import { computed, inject } from 'vue'
import { useHead } from '@vueuse/head'
import config from '/@/config'
import config from '@/config'
const lang: string = inject('lang') || ''
const props = defineProps({
Expand Down
8 changes: 4 additions & 4 deletions src/components/blog/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@
import { onMounted, ref } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { isClient } from '@vueuse/core'
import isArticle from '/@libs/isArticle'
import shuffle from '/@libs/shuffle'
import isMobile from '/@libs/isMobile'
import isDev from '/@libs/isDev'
import isArticle from '@libs/isArticle'
import shuffle from '@libs/shuffle'
import isMobile from '@libs/isMobile'
import isDev from '@libs/isDev'
interface List {
path: string
Expand Down
2 changes: 1 addition & 1 deletion src/libs/dateDisplay.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* 计算一些日期的显示
*/
import dayjs from '/@libs/dayjs'
import dayjs from '@libs/dayjs'

interface DateInfo {
diffDays: number
Expand Down
2 changes: 1 addition & 1 deletion src/libs/isArticle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @param {string} lang - 语言缩写, e.g. en, zh-CN
*/
import { RouteRecordRaw } from 'vue-router'
import config from '/@/config'
import config from '@/config'

const { defaultLang } = config

Expand Down
8 changes: 4 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import '@purge-icons/generated'
/**
* 导入本地依赖
*/
import { routes, scrollBehavior } from '/@/router'
import App from '/@/App.vue'
import { routes, scrollBehavior } from '@/router'
import App from '@/App.vue'

/**
* 导入全局样式
*/
import 'windi.css'
import '/@postcss/global.postcss'
import '/@postcss/markdown.postcss'
import '@postcss/global.postcss'
import '@postcss/markdown.postcss'

/**
* 创建实例
Expand Down
2 changes: 1 addition & 1 deletion src/router/categories.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import config from '/@/config'
import config from '@/config'

let routes: any[] = []
const { defaultLang, i18n } = config
Expand Down
2 changes: 1 addition & 1 deletion src/views/[...all].vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { ref, inject } from 'vue'
import { onBeforeRouteLeave, useRouter } from 'vue-router'
import { useHead } from '@vueuse/head'
import { isClient } from '@vueuse/core'
import config from '/@/config'
import config from '@/config'
const router = useRouter()
const seconds = ref<number>(10)
Expand Down
2 changes: 1 addition & 1 deletion src/views/en/[...all].vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import { useHead } from '@vueuse/head'
import { isClient } from '@vueuse/core'
import { ref, inject } from 'vue'
import config from '/@/config'
import config from '@/config'
import { onBeforeRouteLeave, useRouter } from 'vue-router'
const router = useRouter()
Expand Down
2 changes: 1 addition & 1 deletion src/views/en/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script setup lang="ts">
import { inject } from 'vue'
import { useHead } from '@vueuse/head'
import config from '/@/config'
import config from '@/config'
const lang: string = inject('lang') || ''
Expand Down
2 changes: 1 addition & 1 deletion src/views/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script setup lang="ts">
import { inject } from 'vue'
import { useHead } from '@vueuse/head'
import config from '/@/config'
import config from '@/config'
const lang: string = inject('lang') || ''
Expand Down
143 changes: 64 additions & 79 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,79 +1,64 @@
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"esModuleInterop": true,
"incremental": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": "./",
"types": [
"vite/client",
"node",
"vite-plugin-pages/client",
"vite-plugin-pwa/client"
],
"paths": {
"/@/*": [
"src/*"
],
"/@img/*": [
"src/assets/img/*"
],
"/@styl/*": [
"src/assets/styl/*"
],
"/@js/*": [
"src/assets/js/*"
],
"/@ts/*": [
"src/assets/ts/*"
],
"/@fonts/*": [
"src/assets/fonts/*"
],
"/@css/*": [
"src/assets/css/*"
],
"/@libs/*": [
"src/libs/*"
],
"/@cp/*": [
"src/components/*"
],
"/@views/*": [
"src/views/*"
],
"/@plugins/*": [
"src/plugins/*"
]
},
"lib": [
"esnext",
"dom"
],
"plugins": [
{
"name": "@vuedx/typescript-plugin-vue"
}
]
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue"
],
"exclude": [
"dist",
"node_modules"
]
}
{
"compilerOptions": {
"target": "esnext",
"module": "esnext",
"strict": true,
"jsx": "preserve",
"importHelpers": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
"skipLibCheck": true,
"esModuleInterop": true,
"incremental": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"baseUrl": "./",
"types": [
"vite/client",
"node",
"vite-plugin-pages/client",
"vite-plugin-pwa/client"
],
"paths": {
"@/*": [
"src/*"
],
"@img/*": [
"src/assets/img/*"
],
"@postcss/*": [
"src/assets/postcss/*"
],
"@libs/*": [
"src/libs/*"
],
"@cp/*": [
"src/components/*"
],
"@views/*": [
"src/views/*"
]
},
"lib": [
"esnext",
"dom"
],
"plugins": [
{
"name": "@vuedx/typescript-plugin-vue"
}
]
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue"
],
"exclude": [
"dist",
"node_modules"
]
}
13 changes: 6 additions & 7 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ export default defineConfig({
},
resolve: {
alias: {
'/@': resolve('src'),
'/@img': resolve('src/assets/img'),
'/@postcss': resolve('src/assets/postcss'),
'/@ts': resolve('src/assets/ts'),
'/@libs': resolve('src/libs'),
'/@cp': resolve('src/components'),
'/@views': resolve('src/views'),
'@': resolve('src'),
'@img': resolve('src/assets/img'),
'@postcss': resolve('src/assets/postcss'),
'@libs': resolve('src/libs'),
'@cp': resolve('src/components'),
'@views': resolve('src/views'),
},
},
optimizeDeps: {
Expand Down

0 comments on commit a36b3e5

Please sign in to comment.