From 03cd680d71d13a6766ec14b53b95f36a70f0ce15 Mon Sep 17 00:00:00 2001 From: xiaosi <2652281683@qq.com> Date: Mon, 27 Nov 2023 14:14:12 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E9=9B=86=E6=88=90=E3=80=91.editorconf?= =?UTF-8?q?ig=EF=BC=9A=E7=BC=96=E8=BE=91=E5=99=A8=E9=A3=8E=E6=A0=BC?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .editorconfig | 7 ++ .eslintrc.cjs | 16 +-- package.json | 42 +++---- src/App.vue | 100 ++++++++-------- src/assets/base.css | 92 +++++++------- src/assets/logo.svg | 5 +- src/assets/main.css | 38 +++--- src/components/HelloWorld.vue | 44 +++---- src/components/TheWelcome.vue | 132 ++++++++++----------- src/components/WelcomeItem.vue | 122 +++++++++---------- src/components/icons/IconCommunity.vue | 10 +- src/components/icons/IconDocumentation.vue | 10 +- src/components/icons/IconEcosystem.vue | 10 +- src/components/icons/IconSupport.vue | 10 +- src/components/icons/IconTooling.vue | 32 ++--- src/main.js | 4 +- src/router/index.js | 34 +++--- src/stores/counter.js | 17 +-- src/views/AboutView.vue | 16 +-- src/views/HomeView.vue | 6 +- vite.config.js | 20 ++-- 21 files changed, 388 insertions(+), 379 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..409b502 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +[*.{js,json,jsx,ts,tsx,vue,cjs}] +indent_style = space +indent_size = 4 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 180 diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 15f62d7..ee341f6 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -1,11 +1,11 @@ /* eslint-env node */ module.exports = { - root: true, - 'extends': [ - 'plugin:vue/vue3-essential', - 'eslint:recommended' - ], - parserOptions: { - ecmaVersion: 'latest' - } + root: true, + 'extends': [ + 'plugin:vue/vue3-essential', + 'eslint:recommended' + ], + parserOptions: { + ecmaVersion: 'latest' + } } diff --git a/package.json b/package.json index a40ee06..a9113ff 100644 --- a/package.json +++ b/package.json @@ -1,23 +1,23 @@ { - "name": "sg-cloud", - "version": "0.0.0", - "private": true, - "scripts": { - "dev": "vite", - "build": "vite build", - "preview": "vite preview", - "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" - }, - "dependencies": { - "pinia": "^2.1.7", - "vue": "^3.3.4", - "vue-router": "^4.2.5" - }, - "devDependencies": { - "@vitejs/plugin-vue": "^4.4.0", - "@vitejs/plugin-vue-jsx": "^3.0.2", - "eslint": "^8.49.0", - "eslint-plugin-vue": "^9.17.0", - "vite": "^4.4.11" - } + "name": "sg-cloud", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" + }, + "dependencies": { + "pinia": "^2.1.7", + "vue": "^3.3.4", + "vue-router": "^4.2.5" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^4.4.0", + "@vitejs/plugin-vue-jsx": "^3.0.2", + "eslint": "^8.49.0", + "eslint-plugin-vue": "^9.17.0", + "vite": "^4.4.11" + } } diff --git a/src/App.vue b/src/App.vue index e864195..542e05e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,85 +1,85 @@ diff --git a/src/assets/base.css b/src/assets/base.css index 8816868..e055f8d 100644 --- a/src/assets/base.css +++ b/src/assets/base.css @@ -1,73 +1,71 @@ /* color palette from */ :root { - --vt-c-white: #ffffff; - --vt-c-white-soft: #f8f8f8; - --vt-c-white-mute: #f2f2f2; + --vt-c-white: #ffffff; + --vt-c-white-soft: #f8f8f8; + --vt-c-white-mute: #f2f2f2; - --vt-c-black: #181818; - --vt-c-black-soft: #222222; - --vt-c-black-mute: #282828; + --vt-c-black: #181818; + --vt-c-black-soft: #222222; + --vt-c-black-mute: #282828; - --vt-c-indigo: #2c3e50; + --vt-c-indigo: #2c3e50; - --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); - --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); - --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); - --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); + --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); + --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); + --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); + --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); - --vt-c-text-light-1: var(--vt-c-indigo); - --vt-c-text-light-2: rgba(60, 60, 60, 0.66); - --vt-c-text-dark-1: var(--vt-c-white); - --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); + --vt-c-text-light-1: var(--vt-c-indigo); + --vt-c-text-light-2: rgba(60, 60, 60, 0.66); + --vt-c-text-dark-1: var(--vt-c-white); + --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); } /* semantic color variables for this project */ :root { - --color-background: var(--vt-c-white); - --color-background-soft: var(--vt-c-white-soft); - --color-background-mute: var(--vt-c-white-mute); + --color-background: var(--vt-c-white); + --color-background-soft: var(--vt-c-white-soft); + --color-background-mute: var(--vt-c-white-mute); - --color-border: var(--vt-c-divider-light-2); - --color-border-hover: var(--vt-c-divider-light-1); + --color-border: var(--vt-c-divider-light-2); + --color-border-hover: var(--vt-c-divider-light-1); - --color-heading: var(--vt-c-text-light-1); - --color-text: var(--vt-c-text-light-1); + --color-heading: var(--vt-c-text-light-1); + --color-text: var(--vt-c-text-light-1); - --section-gap: 160px; + --section-gap: 160px; } @media (prefers-color-scheme: dark) { - :root { - --color-background: var(--vt-c-black); - --color-background-soft: var(--vt-c-black-soft); - --color-background-mute: var(--vt-c-black-mute); + :root { + --color-background: var(--vt-c-black); + --color-background-soft: var(--vt-c-black-soft); + --color-background-mute: var(--vt-c-black-mute); - --color-border: var(--vt-c-divider-dark-2); - --color-border-hover: var(--vt-c-divider-dark-1); + --color-border: var(--vt-c-divider-dark-2); + --color-border-hover: var(--vt-c-divider-dark-1); - --color-heading: var(--vt-c-text-dark-1); - --color-text: var(--vt-c-text-dark-2); - } + --color-heading: var(--vt-c-text-dark-1); + --color-text: var(--vt-c-text-dark-2); + } } *, *::before, *::after { - box-sizing: border-box; - margin: 0; - font-weight: normal; + box-sizing: border-box; + margin: 0; + font-weight: normal; } body { - min-height: 100vh; - color: var(--color-text); - background: var(--color-background); - transition: - color 0.5s, + min-height: 100vh; + color: var(--color-text); + background: var(--color-background); + transition: color 0.5s, background-color 0.5s; - line-height: 1.6; - font-family: - Inter, + line-height: 1.6; + font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', @@ -79,8 +77,8 @@ body { 'Droid Sans', 'Helvetica Neue', sans-serif; - font-size: 15px; - text-rendering: optimizeLegibility; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; + font-size: 15px; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; } diff --git a/src/assets/logo.svg b/src/assets/logo.svg index 7565660..a228bdc 100644 --- a/src/assets/logo.svg +++ b/src/assets/logo.svg @@ -1 +1,4 @@ - + + + + diff --git a/src/assets/main.css b/src/assets/main.css index e8667cd..38258c5 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -1,35 +1,35 @@ @import './base.css'; #app { - max-width: 1280px; - margin: 0 auto; - padding: 2rem; + max-width: 1280px; + margin: 0 auto; + padding: 2rem; - font-weight: normal; + font-weight: normal; } a, .green { - text-decoration: none; - color: hsla(160, 100%, 37%, 1); - transition: 0.4s; + text-decoration: none; + color: hsla(160, 100%, 37%, 1); + transition: 0.4s; } @media (hover: hover) { - a:hover { - background-color: hsla(160, 100%, 37%, 0.2); - } + a:hover { + background-color: hsla(160, 100%, 37%, 0.2); + } } @media (min-width: 1024px) { - body { - display: flex; - place-items: center; - } + body { + display: flex; + place-items: center; + } - #app { - display: grid; - grid-template-columns: 1fr 1fr; - padding: 0 2rem; - } + #app { + display: grid; + grid-template-columns: 1fr 1fr; + padding: 0 2rem; + } } diff --git a/src/components/HelloWorld.vue b/src/components/HelloWorld.vue index 5fb372c..9189bed 100644 --- a/src/components/HelloWorld.vue +++ b/src/components/HelloWorld.vue @@ -1,44 +1,44 @@ diff --git a/src/components/TheWelcome.vue b/src/components/TheWelcome.vue index dab9536..c4f56a2 100644 --- a/src/components/TheWelcome.vue +++ b/src/components/TheWelcome.vue @@ -8,81 +8,81 @@ import SupportIcon from './icons/IconSupport.vue' diff --git a/src/components/WelcomeItem.vue b/src/components/WelcomeItem.vue index ac366d0..aa9c3e2 100644 --- a/src/components/WelcomeItem.vue +++ b/src/components/WelcomeItem.vue @@ -1,86 +1,86 @@ diff --git a/src/components/icons/IconCommunity.vue b/src/components/icons/IconCommunity.vue index 2dc8b05..36348e2 100644 --- a/src/components/icons/IconCommunity.vue +++ b/src/components/icons/IconCommunity.vue @@ -1,7 +1,7 @@ diff --git a/src/components/icons/IconDocumentation.vue b/src/components/icons/IconDocumentation.vue index 6d4791c..0c0fa76 100644 --- a/src/components/icons/IconDocumentation.vue +++ b/src/components/icons/IconDocumentation.vue @@ -1,7 +1,7 @@ diff --git a/src/components/icons/IconEcosystem.vue b/src/components/icons/IconEcosystem.vue index c3a4f07..0702bbb 100644 --- a/src/components/icons/IconEcosystem.vue +++ b/src/components/icons/IconEcosystem.vue @@ -1,7 +1,7 @@ diff --git a/src/components/icons/IconSupport.vue b/src/components/icons/IconSupport.vue index 7452834..908b94c 100644 --- a/src/components/icons/IconSupport.vue +++ b/src/components/icons/IconSupport.vue @@ -1,7 +1,7 @@ diff --git a/src/components/icons/IconTooling.vue b/src/components/icons/IconTooling.vue index 660598d..9e82068 100644 --- a/src/components/icons/IconTooling.vue +++ b/src/components/icons/IconTooling.vue @@ -1,19 +1,19 @@ diff --git a/src/main.js b/src/main.js index 5dcad83..7ca6cbc 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,7 @@ import './assets/main.css' -import { createApp } from 'vue' -import { createPinia } from 'pinia' +import {createApp} from 'vue' +import {createPinia} from 'pinia' import App from './App.vue' import router from './router' diff --git a/src/router/index.js b/src/router/index.js index a49ae50..ff8fe9e 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,23 +1,23 @@ -import { createRouter, createWebHistory } from 'vue-router' +import {createRouter, createWebHistory} from 'vue-router' import HomeView from '../views/HomeView.vue' const router = createRouter({ - history: createWebHistory(import.meta.env.BASE_URL), - routes: [ - { - path: '/', - name: 'home', - component: HomeView - }, - { - 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: () => import('../views/AboutView.vue') - } - ] + history: createWebHistory(import.meta.env.BASE_URL), + routes: [ + { + path: '/', + name: 'home', + component: HomeView + }, + { + 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: () => import('../views/AboutView.vue') + } + ] }) export default router diff --git a/src/stores/counter.js b/src/stores/counter.js index b6757ba..88e6402 100644 --- a/src/stores/counter.js +++ b/src/stores/counter.js @@ -1,12 +1,13 @@ -import { ref, computed } from 'vue' -import { defineStore } from 'pinia' +import {ref, computed} from 'vue' +import {defineStore} from 'pinia' export const useCounterStore = defineStore('counter', () => { - const count = ref(0) - const doubleCount = computed(() => count.value * 2) - function increment() { - count.value++ - } + const count = ref(0) + const doubleCount = computed(() => count.value * 2) - return { count, doubleCount, increment } + function increment() { + count.value++ + } + + return {count, doubleCount, increment} }) diff --git a/src/views/AboutView.vue b/src/views/AboutView.vue index 756ad2a..f470365 100644 --- a/src/views/AboutView.vue +++ b/src/views/AboutView.vue @@ -1,15 +1,15 @@ diff --git a/src/views/HomeView.vue b/src/views/HomeView.vue index 6bb706f..ee8e477 100644 --- a/src/views/HomeView.vue +++ b/src/views/HomeView.vue @@ -3,7 +3,7 @@ import TheWelcome from '../components/TheWelcome.vue' diff --git a/vite.config.js b/vite.config.js index 36c6187..0171e9f 100644 --- a/vite.config.js +++ b/vite.config.js @@ -1,18 +1,18 @@ -import { fileURLToPath, URL } from 'node:url' +import {fileURLToPath, URL} from 'node:url' -import { defineConfig } from 'vite' +import {defineConfig} from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' // https://vitejs.dev/config/ export default defineConfig({ - plugins: [ - vue(), - vueJsx(), - ], - resolve: { - alias: { - '@': fileURLToPath(new URL('./src', import.meta.url)) + plugins: [ + vue(), + vueJsx(), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } } - } })