Browse Source

【集成】.editorconfig:编辑器风格配置文件

master
xiaosi 1 year ago
parent
commit
03cd680d71
  1. 7
      .editorconfig
  2. 8
      src/App.vue
  3. 6
      src/assets/base.css
  4. 5
      src/assets/logo.svg
  5. 12
      src/components/TheWelcome.vue
  6. 4
      src/main.js
  7. 2
      src/router/index.js
  8. 7
      src/stores/counter.js
  9. 2
      src/views/HomeView.vue
  10. 4
      vite.config.js

7
.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

8
src/App.vue

@ -1,14 +1,14 @@
<script setup>
import { RouterLink, RouterView } from 'vue-router'
import {RouterLink, RouterView} from 'vue-router'
import HelloWorld from './components/HelloWorld.vue'
</script>
<template>
<header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125"/>
<div class="wrapper">
<HelloWorld msg="You did it!" />
<HelloWorld msg="You did it!"/>
<nav>
<RouterLink to="/">Home</RouterLink>
@ -17,7 +17,7 @@ import HelloWorld from './components/HelloWorld.vue'
</div>
</header>
<RouterView />
<RouterView/>
</template>
<style scoped>

6
src/assets/base.css

@ -62,12 +62,10 @@ body {
min-height: 100vh;
color: var(--color-text);
background: var(--color-background);
transition:
color 0.5s,
transition: color 0.5s,
background-color 0.5s;
line-height: 1.6;
font-family:
Inter,
font-family: Inter,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',

5
src/assets/logo.svg

@ -1 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69"><path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/><path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 261.76 226.69">
<path d="M161.096.001l-30.225 52.351L100.647.001H-.005l130.877 226.688L261.749.001z" fill="#41b883"/>
<path d="M161.096.001l-30.225 52.351L100.647.001H52.346l78.526 136.01L209.398.001z" fill="#34495e"/>
</svg>

Before

Width:  |  Height:  |  Size: 276 B

After

Width:  |  Height:  |  Size: 287 B

12
src/components/TheWelcome.vue

@ -10,7 +10,7 @@ import SupportIcon from './icons/IconSupport.vue'
<template>
<WelcomeItem>
<template #icon>
<DocumentationIcon />
<DocumentationIcon/>
</template>
<template #heading>Documentation</template>
@ -21,7 +21,7 @@ import SupportIcon from './icons/IconSupport.vue'
<WelcomeItem>
<template #icon>
<ToolingIcon />
<ToolingIcon/>
</template>
<template #heading>Tooling</template>
@ -36,14 +36,14 @@ import SupportIcon from './icons/IconSupport.vue'
>Cypress Component Testing</a
>.
<br />
<br/>
More instructions are available in <code>README.md</code>.
</WelcomeItem>
<WelcomeItem>
<template #icon>
<EcosystemIcon />
<EcosystemIcon/>
</template>
<template #heading>Ecosystem</template>
@ -59,7 +59,7 @@ import SupportIcon from './icons/IconSupport.vue'
<WelcomeItem>
<template #icon>
<CommunityIcon />
<CommunityIcon/>
</template>
<template #heading>Community</template>
@ -77,7 +77,7 @@ import SupportIcon from './icons/IconSupport.vue'
<WelcomeItem>
<template #icon>
<SupportIcon />
<SupportIcon/>
</template>
<template #heading>Support Vue</template>

4
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'

2
src/router/index.js

@ -1,4 +1,4 @@
import { createRouter, createWebHistory } from 'vue-router'
import {createRouter, createWebHistory} from 'vue-router'
import HomeView from '../views/HomeView.vue'
const router = createRouter({

7
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++
}
return { count, doubleCount, increment }
return {count, doubleCount, increment}
})

2
src/views/HomeView.vue

@ -4,6 +4,6 @@ import TheWelcome from '../components/TheWelcome.vue'
<template>
<main>
<TheWelcome />
<TheWelcome/>
</main>
</template>

4
vite.config.js

@ -1,6 +1,6 @@
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'

Loading…
Cancel
Save