# Basic UniApp Project Template ## 基础 UniApp 项目模板 这是一个基础的 UniApp + uCharts 项目模板。 ### 项目结构 ``` uniapp-ucharts-project/ ├── uni_modules/ │ └── qiun-data-charts/ # uCharts 插件 ├── pages/ │ ├── index/ │ │ └── index.vue │ └── ... ├── static/ # 静态资源 ├── App.vue # 应用入口 ├── main.js # 主入口文件 ├── pages.json # 页面配置 ├── manifest.json # 应用配置 └── uni.scss # 全局样式变量 ``` ### App.vue ```vue ``` ### main.js ```javascript import App from './App' // #ifdef VUE3 import { createSSRApp } from 'vue' export function createApp() { const app = createSSRApp(App) return { app } } // #endif // #ifndef VUE3 import Vue from 'vue' Vue.config.productionTip = false App.mpType = 'app' const app = new Vue({ ...App }) app.$mount() // #endif ``` ### pages.json ```json { "easycom": { "autoscan": true, "custom": { "qiun-data-charts": "@/uni_modules/qiun-data-charts/components/qiun-data-charts/qiun-data-charts.vue" } }, "pages": [ { "path": "pages/index/index", "style": { "navigationBarTitleText": "首页" } } ], "globalStyle": { "navigationBarTextStyle": "black", "navigationBarTitleText": "UniApp", "navigationBarBackgroundColor": "#ffffff", "backgroundColor": "#f5f5f5" } } ``` ### uni.scss ```scss /* uni.scss */ /* 自定义全局变量 */ $uni-color-primary: #409EFF; $uni-bg-color: #f5f5f5; ``` ### manifest.json ```json { "name": "uniapp-ucharts-project", "appid": "", "versionName": "1.0.0", "versionCode": "100", "transformPx": false, "app-plus": { "usingComponents": true }, "h5": { "router": { "mode": "hash" } }, "mp-weixin": { "appid": "", "setting": { "urlCheck": false }, "usingComponents": true } } ``` ### pages/index/index.vue ```vue ```