Переглянути джерело

feat: 根据 cqh 的提示优化代码

Burt 2 роки тому
батько
коміт
5d6b158d0d
4 змінених файлів з 23 додано та 0 видалено
  1. 4 0
      .gitignore
  2. 6 0
      .vscode/settings.json
  3. 11 0
      src/pages-sub/niubi/index.vue
  4. 2 0
      vite.config.ts

+ 4 - 0
.gitignore

@@ -27,3 +27,7 @@ stats.html
 auto-import.d.ts
 # unplugin-vue-components 生成的类型文件
 components.d.ts
+src/pages.json
+uni-pages.d.ts
+src/pages.json
+src/manifest.json

+ 6 - 0
.vscode/settings.json

@@ -24,6 +24,12 @@
   "[vue]": {
     "editor.defaultFormatter": "esbenp.prettier-vscode"
   },
+  "[typescript]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
+  "[jsonc]": {
+    "editor.defaultFormatter": "esbenp.prettier-vscode"
+  },
   // 配置语言的文件关联
   "files.associations": {
     "pages.json": "jsonc", // pages.json 可以写注释

+ 11 - 0
src/pages-sub/niubi/index.vue

@@ -0,0 +1,11 @@
+<template>
+  <div class="niubi">niubi</div>
+</template>
+
+<script lang="ts" setup></script>
+
+<style lang="scss" scoped>
+.niubi {
+  background-color: red;
+}
+</style>

+ 2 - 0
vite.config.ts

@@ -59,6 +59,8 @@ export default ({ command, mode }) => {
         exclude: hideDemoPages
           ? ['**/components/**/**.*', '**/demo/**/**.*']
           : ['**/components/**/**.*'],
+        homePage: 'pages/index/index',
+        subPackages: ['src/pages-sub'],
       }),
       UniLayouts(),
       UniPlatform(),