Browse Source

修改目录结构

caner 1 year ago
parent
commit
14269a9a2a
9 changed files with 6 additions and 10 deletions
  1. 3 7
      README.md
  2. 1 1
      index.html
  3. 1 1
      src/App.vue
  4. 1 1
      src/main.ts
  5. 0 0
      src/pages/home/index.vue
  6. 0 0
      src/pages/home/route.ts
  7. 0 0
      src/pages/test/index.vue
  8. 0 0
      src/pages/test/route.ts
  9. 0 0
      src/store/index.ts

+ 3 - 7
README.md

@@ -2,16 +2,12 @@
 ```
 ```
 | - `src`
 | - `src`
 |   - `pages`                     入口目录
 |   - `pages`                     入口目录
-|           - `assets`            静态文件
-|           - `components`        组件
-|           - `store`             存储
-|           - `views`             页面
-|           - `service`           服务
-|           - `App.vue`           模板
-|           - `main.ts`           入口文件
 |   - `components`                全局组件
 |   - `components`                全局组件
 |   - `services`                  全局服务
 |   - `services`                  全局服务
 |   - `assets`                    全局静态文件
 |   - `assets`                    全局静态文件
+|   - `store`                     全局存储
+|   - `App.vue`                   模板
+|   - `main.ts`                   入口文件
 ```
 ```
 ### 排列规范
 ### 排列规范
 ```
 ```

+ 1 - 1
index.html

@@ -7,6 +7,6 @@
   </head>
   </head>
   <body>
   <body>
     <div id="app"></div>
     <div id="app"></div>
-    <script type="module" src="/src/pages/main.ts"></script>
+    <script type="module" src="/src/main.ts"></script>
   </body>
   </body>
 </html>
 </html>

+ 1 - 1
src/pages/App.vue → src/App.vue

@@ -14,7 +14,7 @@
 </template>
 </template>
 <script setup lang='ts'>
 <script setup lang='ts'>
 import loading from '@/components/loading.vue'
 import loading from '@/components/loading.vue'
-import useStore from './store/index'
+import useStore from '@/store/index'
 import { computed } from 'vue'
 import { computed } from 'vue'
 import { zhCN, dateZhCN } from 'naive-ui'
 import { zhCN, dateZhCN } from 'naive-ui'
 import Theme from '@/assets/naive-theme'
 import Theme from '@/assets/naive-theme'

+ 1 - 1
src/pages/main.ts → src/main.ts

@@ -11,7 +11,7 @@ const store = createPinia()
 store.use(piniaPersist)
 store.use(piniaPersist)
 
 
 // 动态路由
 // 动态路由
-const routes = Object.values(import.meta.glob('./views/*/route.ts', { eager: true, import: 'default' })) as unknown as RouteRecordRaw[]
+const routes = Object.values(import.meta.glob('./pages/*/route.ts', { eager: true, import: 'default' })) as unknown as RouteRecordRaw[]
 routes.push({ path: '/:path(.*)', redirect: '/' })
 routes.push({ path: '/:path(.*)', redirect: '/' })
 
 
 const app = createApp(App)
 const app = createApp(App)

+ 0 - 0
src/pages/views/home/index.vue → src/pages/home/index.vue


+ 0 - 0
src/pages/views/home/route.ts → src/pages/home/route.ts


+ 0 - 0
src/pages/views/test/index.vue → src/pages/test/index.vue


+ 0 - 0
src/pages/views/test/route.ts → src/pages/test/route.ts


+ 0 - 0
src/pages/store/index.ts → src/store/index.ts