parent
							
								
									3d98aa4bc3
								
							
						
					
					
						commit
						c8fddd3770
					
				| @ -0,0 +1,24 @@ | |||||||
|  | module.exports = { | ||||||
|  |   env: { | ||||||
|  |     browser: true, | ||||||
|  |     es2021: true | ||||||
|  |   }, | ||||||
|  |   extends: [ | ||||||
|  |     'plugin:vue/vue3-essential', | ||||||
|  |     'standard' | ||||||
|  |   ], | ||||||
|  |   overrides: [ | ||||||
|  |   ], | ||||||
|  |   parserOptions: { | ||||||
|  |     ecmaVersion: 'latest', | ||||||
|  |     sourceType: 'module' | ||||||
|  |   }, | ||||||
|  |   plugins: [ | ||||||
|  |     'vue' | ||||||
|  |   ], | ||||||
|  |   rules: { | ||||||
|  |     'vue/multi-word-component-names': 0, | ||||||
|  |     'space-before-function-paren': ['error', 'never'], // 函数名与括号之间无空格
 | ||||||
|  |     quotes: ['error', 'single'] // 单引号
 | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,24 @@ | |||||||
|  | # Logs | ||||||
|  | logs | ||||||
|  | *.log | ||||||
|  | npm-debug.log* | ||||||
|  | yarn-debug.log* | ||||||
|  | yarn-error.log* | ||||||
|  | pnpm-debug.log* | ||||||
|  | lerna-debug.log* | ||||||
|  | 
 | ||||||
|  | node_modules | ||||||
|  | dist | ||||||
|  | dist-ssr | ||||||
|  | *.local | ||||||
|  | 
 | ||||||
|  | # Editor directories and files | ||||||
|  | .vscode/* | ||||||
|  | !.vscode/extensions.json | ||||||
|  | .idea | ||||||
|  | .DS_Store | ||||||
|  | *.suo | ||||||
|  | *.ntvs* | ||||||
|  | *.njsproj | ||||||
|  | *.sln | ||||||
|  | *.sw? | ||||||
| @ -0,0 +1,9 @@ | |||||||
|  | { | ||||||
|  |   "useTabs": false, | ||||||
|  |   "tabWidth": 2, | ||||||
|  |   "printWidth": 100, | ||||||
|  |   "singleQuote": true, | ||||||
|  |   "trailingComma": "none", | ||||||
|  |   "bracketSpacing": true, | ||||||
|  |   "semi": false | ||||||
|  | } | ||||||
| @ -0,0 +1,3 @@ | |||||||
|  | { | ||||||
|  |   "recommendations": ["Vue.volar"] | ||||||
|  | } | ||||||
| @ -0,0 +1,7 @@ | |||||||
|  | # Vue 3 + Vite | ||||||
|  | 
 | ||||||
|  | This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. | ||||||
|  | 
 | ||||||
|  | ## Recommended IDE Setup | ||||||
|  | 
 | ||||||
|  | - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) | ||||||
| @ -0,0 +1,13 @@ | |||||||
|  | <!DOCTYPE html> | ||||||
|  | <html lang="en"> | ||||||
|  |   <head> | ||||||
|  |     <meta charset="UTF-8" /> | ||||||
|  |     <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||||||
|  |     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||||
|  |     <title>Vite + Vue</title> | ||||||
|  |   </head> | ||||||
|  |   <body> | ||||||
|  |     <div id="app"></div> | ||||||
|  |     <script type="module" src="/src/main.js"></script> | ||||||
|  |   </body> | ||||||
|  | </html> | ||||||
											
												
													File diff suppressed because it is too large
													Load Diff
												
											
										
									
								| @ -0,0 +1,32 @@ | |||||||
|  | { | ||||||
|  |   "name": "admin", | ||||||
|  |   "private": true, | ||||||
|  |   "version": "0.0.0", | ||||||
|  |   "type": "module", | ||||||
|  |   "scripts": { | ||||||
|  |     "dev": "vite", | ||||||
|  |     "build": "vite build", | ||||||
|  |     "preview": "vite preview" | ||||||
|  |   }, | ||||||
|  |   "dependencies": { | ||||||
|  |     "@element-plus/icons-vue": "^2.0.10", | ||||||
|  |     "axios": "^1.1.3", | ||||||
|  |     "element-plus": "^2.2.19", | ||||||
|  |     "pinia": "^2.0.23", | ||||||
|  |     "screenfull": "^6.0.2", | ||||||
|  |     "vue": "^3.2.41", | ||||||
|  |     "vue-router": "^4.1.6" | ||||||
|  |   }, | ||||||
|  |   "devDependencies": { | ||||||
|  |     "@vitejs/plugin-vue": "^3.2.0", | ||||||
|  |     "eslint": "^8.26.0", | ||||||
|  |     "eslint-config-standard": "^17.0.0", | ||||||
|  |     "eslint-plugin-import": "^2.26.0", | ||||||
|  |     "eslint-plugin-n": "^15.4.0", | ||||||
|  |     "eslint-plugin-promise": "^6.1.1", | ||||||
|  |     "eslint-plugin-vue": "^9.7.0", | ||||||
|  |     "prettier": "^2.7.1", | ||||||
|  |     "sass": "^1.56.0", | ||||||
|  |     "vite": "^3.2.0" | ||||||
|  |   } | ||||||
|  | } | ||||||
| After Width: | Height: | Size: 1.5 KiB | 
| @ -0,0 +1,7 @@ | |||||||
|  | <template> | ||||||
|  |   <router-view /> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script setup></script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped></style> | ||||||
| @ -0,0 +1,9 @@ | |||||||
|  | .el-input__wrapper { | ||||||
|  |   background-color: #34495e !important; | ||||||
|  |   padding: 5px 16px; | ||||||
|  |   box-shadow: none; | ||||||
|  |   .el-input__inner { | ||||||
|  |     color: #eee; | ||||||
|  |     padding-left: 5px; | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,11 @@ | |||||||
|  | @import './element.scss'; | ||||||
|  | 
 | ||||||
|  | * { | ||||||
|  |   margin: 0; | ||||||
|  |   padding: 0; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #app { | ||||||
|  |   height: 100vh; | ||||||
|  |   font-family: 'Times New Roman', '黑体'; | ||||||
|  | } | ||||||
| @ -0,0 +1,90 @@ | |||||||
|  | :root { | ||||||
|  |   font-family: Inter, Avenir, Helvetica, Arial, sans-serif; | ||||||
|  |   font-size: 16px; | ||||||
|  |   line-height: 24px; | ||||||
|  |   font-weight: 400; | ||||||
|  | 
 | ||||||
|  |   color-scheme: light dark; | ||||||
|  |   color: rgba(255, 255, 255, 0.87); | ||||||
|  |   background-color: #242424; | ||||||
|  | 
 | ||||||
|  |   font-synthesis: none; | ||||||
|  |   text-rendering: optimizeLegibility; | ||||||
|  |   -webkit-font-smoothing: antialiased; | ||||||
|  |   -moz-osx-font-smoothing: grayscale; | ||||||
|  |   -webkit-text-size-adjust: 100%; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | a { | ||||||
|  |   font-weight: 500; | ||||||
|  |   color: #646cff; | ||||||
|  |   text-decoration: inherit; | ||||||
|  | } | ||||||
|  | a:hover { | ||||||
|  |   color: #535bf2; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | a { | ||||||
|  |   font-weight: 500; | ||||||
|  |   color: #646cff; | ||||||
|  |   text-decoration: inherit; | ||||||
|  | } | ||||||
|  | a:hover { | ||||||
|  |   color: #535bf2; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | body { | ||||||
|  |   margin: 0; | ||||||
|  |   display: flex; | ||||||
|  |   place-items: center; | ||||||
|  |   min-width: 320px; | ||||||
|  |   min-height: 100vh; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | h1 { | ||||||
|  |   font-size: 3.2em; | ||||||
|  |   line-height: 1.1; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | button { | ||||||
|  |   border-radius: 8px; | ||||||
|  |   border: 1px solid transparent; | ||||||
|  |   padding: 0.6em 1.2em; | ||||||
|  |   font-size: 1em; | ||||||
|  |   font-weight: 500; | ||||||
|  |   font-family: inherit; | ||||||
|  |   background-color: #1a1a1a; | ||||||
|  |   cursor: pointer; | ||||||
|  |   transition: border-color 0.25s; | ||||||
|  | } | ||||||
|  | button:hover { | ||||||
|  |   border-color: #646cff; | ||||||
|  | } | ||||||
|  | button:focus, | ||||||
|  | button:focus-visible { | ||||||
|  |   outline: 4px auto -webkit-focus-ring-color; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | .card { | ||||||
|  |   padding: 2em; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | #app { | ||||||
|  |   max-width: 1280px; | ||||||
|  |   margin: 0 auto; | ||||||
|  |   padding: 2rem; | ||||||
|  |   text-align: center; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @media (prefers-color-scheme: light) { | ||||||
|  |   :root { | ||||||
|  |     color: #213547; | ||||||
|  |     background-color: #ffffff; | ||||||
|  |   } | ||||||
|  |   a:hover { | ||||||
|  |     color: #747bff; | ||||||
|  |   } | ||||||
|  |   button { | ||||||
|  |     background-color: #f9f9f9; | ||||||
|  |   } | ||||||
|  | } | ||||||
| After Width: | Height: | Size: 496 B | 
| @ -0,0 +1,53 @@ | |||||||
|  | <template> | ||||||
|  |   <div class="header-container"> | ||||||
|  |     <div class="navbar"> | ||||||
|  |       <Hamburger /> | ||||||
|  |       <div class="navbar-right"> | ||||||
|  |         <Screenfull /> | ||||||
|  |         <Avatar class="right-item" /> | ||||||
|  |       </div> | ||||||
|  |     </div> | ||||||
|  |     <div class="tabs-view-container">tabs</div> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script setup> | ||||||
|  | import Hamburger from './components/Hamburger.vue' | ||||||
|  | import Avatar from './components/Avatar.vue' | ||||||
|  | import Screenfull from './components/Screenfull.vue' | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .header-container { | ||||||
|  |   padding: 0; | ||||||
|  |   width: 100%; | ||||||
|  |   height: 100%; | ||||||
|  |   box-shadow: 0 2px 3px #888888; | ||||||
|  |   .navbar { | ||||||
|  |     height: 50px; | ||||||
|  |     display: flex; | ||||||
|  |     align-items: center; | ||||||
|  |     box-sizing: border-box; | ||||||
|  |     position: relative; | ||||||
|  |     .navbar-right { | ||||||
|  |       flex: 1; | ||||||
|  |       display: flex; | ||||||
|  |       align-items: center; | ||||||
|  |       justify-content: flex-end; | ||||||
|  |       overflow: hidden; | ||||||
|  |       margin-right: 15px; | ||||||
|  |       :deep(.right-item) { | ||||||
|  |         display: inline-block; | ||||||
|  |         margin-left: 18px; | ||||||
|  |         font-size: 22px; | ||||||
|  |         color: #5a5e66; | ||||||
|  |         box-sizing: border-box; | ||||||
|  |         cursor: pointer; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   .tabs-view-container { | ||||||
|  |     height: 35px; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @ -0,0 +1,24 @@ | |||||||
|  | <template> | ||||||
|  |   <el-dropdown> | ||||||
|  |     <span class="el-dropdown-link"> | ||||||
|  |       <el-avatar :src="circleUrl" /> | ||||||
|  |     </span> | ||||||
|  |     <template #dropdown> | ||||||
|  |       <el-dropdown-menu> | ||||||
|  |         <el-dropdown-item @click="logout">退出</el-dropdown-item> | ||||||
|  |       </el-dropdown-menu> | ||||||
|  |     </template> | ||||||
|  |   </el-dropdown> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script setup> | ||||||
|  | import { ref } from 'vue' | ||||||
|  | 
 | ||||||
|  | const circleUrl = ref('https://liuyxcc.github.io/img/avatar.png') | ||||||
|  | 
 | ||||||
|  | const logout = () => { | ||||||
|  |   console.log('logout') | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped></style> | ||||||
| @ -0,0 +1,29 @@ | |||||||
|  | <template> | ||||||
|  |   <div class="hamburger-container" @click="toggleCollapse"> | ||||||
|  |     <el-icon size="25px"> | ||||||
|  |       <component :is="icon"></component> | ||||||
|  |     </el-icon> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script setup> | ||||||
|  | import { useStore } from '../../../store' | ||||||
|  | import { computed } from 'vue' | ||||||
|  | 
 | ||||||
|  | const store = useStore() | ||||||
|  | 
 | ||||||
|  | const icon = computed(() => { | ||||||
|  |   return !store.collapse ? 'Fold' : 'Expand' | ||||||
|  | }) | ||||||
|  | 
 | ||||||
|  | const toggleCollapse = () => { | ||||||
|  |   store.changeCollapse() | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .hamburger-container { | ||||||
|  |   cursor: pointer; | ||||||
|  |   margin-left: 10px; | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @ -0,0 +1,22 @@ | |||||||
|  | <template> | ||||||
|  |   <el-icon size="25px" class="screenfull" @click="toggleScreen"> | ||||||
|  |     <FullScreen /> | ||||||
|  |   </el-icon> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script setup> | ||||||
|  | import screenfull from 'screenfull' | ||||||
|  | 
 | ||||||
|  | // 利用screenfull插件实现全屏展示 | ||||||
|  | const toggleScreen = () => { | ||||||
|  |   if (screenfull.isEnabled) { | ||||||
|  |     screenfull.toggle() | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .screenfull { | ||||||
|  |   cursor: pointer; | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @ -0,0 +1,47 @@ | |||||||
|  | <template> | ||||||
|  |   <el-menu | ||||||
|  |     active-text-color="#409EFF" | ||||||
|  |     background-color="#304156" | ||||||
|  |     default-active="1" | ||||||
|  |     text-color="#fff" | ||||||
|  |     unique-opened="true" | ||||||
|  |     :collapse="store.collapse" | ||||||
|  |   > | ||||||
|  |     <!-- 首页栏 --> | ||||||
|  |     <el-sub-menu index="1"> | ||||||
|  |       <template #title> | ||||||
|  |         <el-icon><HomeFilled /></el-icon> | ||||||
|  |         <span>首页</span> | ||||||
|  |       </template> | ||||||
|  |       <el-menu-item index="1-1">首页展示</el-menu-item> | ||||||
|  |     </el-sub-menu> | ||||||
|  |     <!-- 文章管理  --> | ||||||
|  |     <el-sub-menu index="2"> | ||||||
|  |       <template #title> | ||||||
|  |         <el-icon><Document /></el-icon> | ||||||
|  |         <span>文章管理</span> | ||||||
|  |       </template> | ||||||
|  |       <el-menu-item index="2-1">发布文章</el-menu-item> | ||||||
|  |       <el-menu-item index="2-2">文章列表</el-menu-item> | ||||||
|  |       <el-menu-item index="2-3">标签管理</el-menu-item> | ||||||
|  |       <el-menu-item index="2-4">分类管理</el-menu-item> | ||||||
|  |     </el-sub-menu> | ||||||
|  |     <!-- 用户管理  --> | ||||||
|  |     <el-sub-menu index="3"> | ||||||
|  |       <template #title> | ||||||
|  |         <el-icon><UserFilled /></el-icon> | ||||||
|  |         <span>用户管理</span> | ||||||
|  |       </template> | ||||||
|  |       <el-menu-item index="3-1">用户列表</el-menu-item> | ||||||
|  |     </el-sub-menu> | ||||||
|  |   </el-menu> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script setup> | ||||||
|  | import { HomeFilled, Document, UserFilled } from '@element-plus/icons-vue' | ||||||
|  | import { useStore } from '../../store' | ||||||
|  | 
 | ||||||
|  | const store = useStore() | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped></style> | ||||||
| @ -0,0 +1,18 @@ | |||||||
|  | import { createApp } from 'vue' | ||||||
|  | // import './style.css'
 | ||||||
|  | import App from './App.vue' | ||||||
|  | import ElementPlus from 'element-plus' | ||||||
|  | import 'element-plus/dist/index.css' | ||||||
|  | import './assets/scss/index.scss' | ||||||
|  | import router from './router' | ||||||
|  | import { createPinia } from 'pinia' | ||||||
|  | import * as ElementPlusIconsVue from '@element-plus/icons-vue' | ||||||
|  | 
 | ||||||
|  | const app = createApp(App) | ||||||
|  | const pinia = createPinia() | ||||||
|  | 
 | ||||||
|  | for (const [key, component] of Object.entries(ElementPlusIconsVue)) { | ||||||
|  |   app.component(key, component) | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | app.use(pinia).use(router).use(ElementPlus).mount('#app') | ||||||
| @ -0,0 +1,20 @@ | |||||||
|  | import { createRouter, createWebHashHistory } from 'vue-router' | ||||||
|  | 
 | ||||||
|  | const routes = [ | ||||||
|  |   { | ||||||
|  |     path: '/', | ||||||
|  |     name: '/', | ||||||
|  |     component: () => import('../layout/index.vue') | ||||||
|  |   }, | ||||||
|  |   { | ||||||
|  |     path: '/login', | ||||||
|  |     component: () => import('@/views/login/Login.vue') | ||||||
|  |   } | ||||||
|  | ] | ||||||
|  | 
 | ||||||
|  | const router = createRouter({ | ||||||
|  |   history: createWebHashHistory(), | ||||||
|  |   routes | ||||||
|  | }) | ||||||
|  | 
 | ||||||
|  | export default router | ||||||
| @ -0,0 +1,12 @@ | |||||||
|  | import { defineStore } from 'pinia' | ||||||
|  | 
 | ||||||
|  | export const useStore = defineStore('store', { | ||||||
|  |   state: () => ({ | ||||||
|  |     collapse: false | ||||||
|  |   }), | ||||||
|  |   actions: { | ||||||
|  |     changeCollapse() { | ||||||
|  |       this.collapse = !this.collapse | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | }) | ||||||
| @ -0,0 +1,85 @@ | |||||||
|  | <template> | ||||||
|  |   <div class="container"> | ||||||
|  |     <div class="login-container"> | ||||||
|  |       <h1>Login</h1> | ||||||
|  |       <el-form | ||||||
|  |         ref="formRef" | ||||||
|  |         :model="loginForm" | ||||||
|  |         status-icon | ||||||
|  |         :rules="rules" | ||||||
|  |         size="large" | ||||||
|  |         class="login-form" | ||||||
|  |       > | ||||||
|  |         <el-form-item prop="username"> | ||||||
|  |           <el-input | ||||||
|  |             v-model="loginForm.username" | ||||||
|  |             placeholder="请输入用户名" | ||||||
|  |             prefix-icon="User" | ||||||
|  |             clearable | ||||||
|  |           /> | ||||||
|  |         </el-form-item> | ||||||
|  |         <el-form-item prop="password"> | ||||||
|  |           <el-input | ||||||
|  |             v-model="loginForm.password" | ||||||
|  |             placeholder="请输入密码" | ||||||
|  |             prefix-icon="Lock" | ||||||
|  |             show-password | ||||||
|  |           /> | ||||||
|  |         </el-form-item> | ||||||
|  |         <el-form-item> | ||||||
|  |           <el-button type="primary" @click="submitForm(formRef)">登录</el-button> | ||||||
|  |         </el-form-item> | ||||||
|  |       </el-form> | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script setup> | ||||||
|  | import { ref } from 'vue' | ||||||
|  | 
 | ||||||
|  | const formRef = ref() | ||||||
|  | const loginForm = ref({ | ||||||
|  |   username: '', | ||||||
|  |   password: '' | ||||||
|  | }) | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped> | ||||||
|  | .container { | ||||||
|  |   display: flex; | ||||||
|  |   justify-content: center; | ||||||
|  |   align-items: center; | ||||||
|  |   height: 100%; | ||||||
|  |   background-color: #2c3e50; | ||||||
|  |   .login-container { | ||||||
|  |     display: flex; | ||||||
|  |     flex-direction: column; | ||||||
|  |     justify-content: center; | ||||||
|  |     align-items: center; | ||||||
|  |     width: 320px; | ||||||
|  |     height: 470px; | ||||||
|  |     background-color: #34495e; | ||||||
|  |     border-radius: 10px; | ||||||
|  |     box-shadow: 10px 10px 20px rgba(33, 44, 55, 0.3); | ||||||
|  |     color: #eee; | ||||||
|  |     h1 { | ||||||
|  |       font-size: 45px; | ||||||
|  |       font-weight: 400; | ||||||
|  |       padding: 30px 0; | ||||||
|  |     } | ||||||
|  |     .login-form { | ||||||
|  |       width: 260px; | ||||||
|  |     } | ||||||
|  |     .el-input { | ||||||
|  |       background-color: #34495e; | ||||||
|  |       font-size: 15px; | ||||||
|  |       .el-input__wrapper { | ||||||
|  |         background-color: #34495e !important; | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | .el-button { | ||||||
|  |   width: 100%; | ||||||
|  | } | ||||||
|  | </style> | ||||||
| @ -0,0 +1,13 @@ | |||||||
|  | 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') // 利用@代替src
 | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | }) | ||||||
| @ -0,0 +1,24 @@ | |||||||
|  | module.exports = { | ||||||
|  |   env: { | ||||||
|  |     browser: true, | ||||||
|  |     es2021: true | ||||||
|  |   }, | ||||||
|  |   extends: [ | ||||||
|  |     'plugin:vue/vue3-essential', | ||||||
|  |     'standard' | ||||||
|  |   ], | ||||||
|  |   overrides: [ | ||||||
|  |   ], | ||||||
|  |   parserOptions: { | ||||||
|  |     ecmaVersion: 'latest', | ||||||
|  |     sourceType: 'module' | ||||||
|  |   }, | ||||||
|  |   plugins: [ | ||||||
|  |     'vue' | ||||||
|  |   ], | ||||||
|  |   rules: { | ||||||
|  |     'vue/multi-word-component-names': 0, | ||||||
|  |     'space-before-function-paren': ['error', 'never'], // 函数名与括号之间无空格
 | ||||||
|  |     quotes: ['error', 'single'] // 单引号
 | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -0,0 +1,24 @@ | |||||||
|  | # Logs | ||||||
|  | logs | ||||||
|  | *.log | ||||||
|  | npm-debug.log* | ||||||
|  | yarn-debug.log* | ||||||
|  | yarn-error.log* | ||||||
|  | pnpm-debug.log* | ||||||
|  | lerna-debug.log* | ||||||
|  | 
 | ||||||
|  | node_modules | ||||||
|  | dist | ||||||
|  | dist-ssr | ||||||
|  | *.local | ||||||
|  | 
 | ||||||
|  | # Editor directories and files | ||||||
|  | .vscode/* | ||||||
|  | !.vscode/extensions.json | ||||||
|  | .idea | ||||||
|  | .DS_Store | ||||||
|  | *.suo | ||||||
|  | *.ntvs* | ||||||
|  | *.njsproj | ||||||
|  | *.sln | ||||||
|  | *.sw? | ||||||
| @ -0,0 +1,9 @@ | |||||||
|  | { | ||||||
|  |   "useTabs": false, | ||||||
|  |   "tabWidth": 2, | ||||||
|  |   "printWidth": 100, | ||||||
|  |   "singleQuote": true, | ||||||
|  |   "trailingComma": "none", | ||||||
|  |   "bracketSpacing": true, | ||||||
|  |   "semi": false | ||||||
|  | } | ||||||
| @ -0,0 +1,3 @@ | |||||||
|  | { | ||||||
|  |   "recommendations": ["Vue.volar"] | ||||||
|  | } | ||||||
| @ -0,0 +1,7 @@ | |||||||
|  | # Vue 3 + Vite | ||||||
|  | 
 | ||||||
|  | This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. | ||||||
|  | 
 | ||||||
|  | ## Recommended IDE Setup | ||||||
|  | 
 | ||||||
|  | - [VS Code](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) | ||||||
| @ -0,0 +1,13 @@ | |||||||
|  | <!DOCTYPE html> | ||||||
|  | <html lang="en"> | ||||||
|  |   <head> | ||||||
|  |     <meta charset="UTF-8" /> | ||||||
|  |     <link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||||||
|  |     <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||||||
|  |     <title>Vite + Vue</title> | ||||||
|  |   </head> | ||||||
|  |   <body> | ||||||
|  |     <div id="app"></div> | ||||||
|  |     <script type="module" src="/src/main.js"></script> | ||||||
|  |   </body> | ||||||
|  | </html> | ||||||
											
												
													File diff suppressed because it is too large
													Load Diff
												
											
										
									
								| @ -0,0 +1,29 @@ | |||||||
|  | { | ||||||
|  |   "name": "blog", | ||||||
|  |   "private": true, | ||||||
|  |   "version": "0.0.0", | ||||||
|  |   "type": "module", | ||||||
|  |   "scripts": { | ||||||
|  |     "dev": "vite", | ||||||
|  |     "build": "vite build", | ||||||
|  |     "preview": "vite preview" | ||||||
|  |   }, | ||||||
|  |   "dependencies": { | ||||||
|  |     "axios": "^1.1.3", | ||||||
|  |     "pinia": "^2.0.23", | ||||||
|  |     "vue": "^3.2.41", | ||||||
|  |     "vue-router": "^4.1.6" | ||||||
|  |   }, | ||||||
|  |   "devDependencies": { | ||||||
|  |     "@vitejs/plugin-vue": "^3.2.0", | ||||||
|  |     "eslint": "^8.27.0", | ||||||
|  |     "eslint-config-standard": "^17.0.0", | ||||||
|  |     "eslint-plugin-import": "^2.26.0", | ||||||
|  |     "eslint-plugin-n": "^15.5.1", | ||||||
|  |     "eslint-plugin-promise": "^6.1.1", | ||||||
|  |     "eslint-plugin-vue": "^9.7.0", | ||||||
|  |     "prettier": "^2.7.1", | ||||||
|  |     "sass": "^1.56.1", | ||||||
|  |     "vite": "^3.2.3" | ||||||
|  |   } | ||||||
|  | } | ||||||
| After Width: | Height: | Size: 1.5 KiB | 
| @ -0,0 +1,7 @@ | |||||||
|  | <template> | ||||||
|  |   <div></div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script setup></script> | ||||||
|  | 
 | ||||||
|  | <style lang="scss" scoped></style> | ||||||
| After Width: | Height: | Size: 496 B | 
| @ -0,0 +1,5 @@ | |||||||
|  | import { createApp } from 'vue' | ||||||
|  | import './style.css' | ||||||
|  | import App from './App.vue' | ||||||
|  | 
 | ||||||
|  | createApp(App).mount('#app') | ||||||
| @ -0,0 +1,7 @@ | |||||||
|  | import { defineConfig } from 'vite' | ||||||
|  | import vue from '@vitejs/plugin-vue' | ||||||
|  | 
 | ||||||
|  | // https://vitejs.dev/config/
 | ||||||
|  | export default defineConfig({ | ||||||
|  |   plugins: [vue()] | ||||||
|  | }) | ||||||
					Loading…
					
					
				
		Reference in new issue