pages.config.ts 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import { defineUniPages } from '@uni-helper/vite-plugin-uni-pages'
  2. import { isWxProd } from './vite.config'
  3. export default defineUniPages({
  4. globalStyle: {
  5. navigationStyle: 'default',
  6. navigationBarTitleText: 'vue3-uniapp',
  7. navigationBarBackgroundColor: '#f8f8f8',
  8. navigationBarTextStyle: 'black',
  9. backgroundColor: '#FFFFFF',
  10. },
  11. easycom: {
  12. autoscan: true,
  13. custom: {
  14. '^fly-(.*)': '@/components/fly-$1/fly-$1.vue',
  15. '^uni-(.*)': '@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue',
  16. },
  17. },
  18. tabBar: {
  19. color: '#999999',
  20. selectedColor: '#018d71',
  21. backgroundColor: '#F8F8F8',
  22. borderStyle: 'black',
  23. height: '50px',
  24. fontSize: '10px',
  25. iconWidth: '24px',
  26. spacing: '3px',
  27. list: isWxProd
  28. ? [
  29. {
  30. iconPath: 'static/tabbar/home.png',
  31. selectedIconPath: 'static/tabbar/homeHL.png',
  32. pagePath: 'pages/index/index',
  33. text: '首页',
  34. },
  35. {
  36. iconPath: 'static/tabbar/personal.png',
  37. selectedIconPath: 'static/tabbar/personalHL.png',
  38. pagePath: 'pages/my/index',
  39. text: '我的',
  40. },
  41. ]
  42. : [
  43. {
  44. iconPath: 'static/tabbar/home.png',
  45. selectedIconPath: 'static/tabbar/homeHL.png',
  46. pagePath: 'pages/index/index',
  47. text: '首页',
  48. },
  49. // 生产环境要注释掉demo,所以分开来写
  50. {
  51. iconPath: 'static/tabbar/example.png',
  52. selectedIconPath: 'static/tabbar/exampleHL.png',
  53. pagePath: 'pages/demo/index',
  54. text: '示例',
  55. },
  56. {
  57. iconPath: 'static/tabbar/personal.png',
  58. selectedIconPath: 'static/tabbar/personalHL.png',
  59. pagePath: 'pages/my/index',
  60. text: '我的',
  61. },
  62. ],
  63. },
  64. // 你也可以定义 pages 字段,它具有最高的优先级。
  65. pages: [],
  66. /**
  67. * subPackages 扫描的目录,例如:src/pages-sub
  68. * @type SubPackage[] | undefined
  69. */
  70. subPackages: undefined,
  71. })