依赖包如下:
"@dcloudio/uni-app": "3.0.0-3061320221209001",
"@dcloudio/uni-app-plus": "3.0.0-3061320221209001",
"@dcloudio/uni-components": "3.0.0-3061320221209001",
"@dcloudio/uni-h5": "3.0.0-3061320221209001",
"@dcloudio/uni-mp-alipay": "3.0.0-3061320221209001",
"@dcloudio/uni-mp-baidu": "3.0.0-3061320221209001",
"@dcloudio/uni-mp-kuaishou": "3.0.0-3061320221209001",
"@dcloudio/uni-mp-lark": "3.0.0-3061320221209001",
"@dcloudio/uni-mp-qq": "3.0.0-3061320221209001",
"@dcloudio/uni-mp-toutiao": "3.0.0-3061320221209001",
"@dcloudio/uni-mp-weixin": "3.0.0-3061320221209001",
"@dcloudio/uni-quickapp-webview": "3.0.0-3061320221209001",
"@dcloudio/uni-ui": "^1.4.23",
"pinia": "^2.0.28",
"staging": "^0.1.3",
"vue": "^3.2.45",
"vue-i18n": "^9.1.9"
},
"devDependencies": {
"@dcloudio/types": "^3.0.17",
"@dcloudio/uni-automator": "3.0.0-3061320221209001",
"@dcloudio/uni-cli-shared": "3.0.0-3061320221209001",
"@dcloudio/uni-stacktracey": "3.0.0-3061320221209001",
"@dcloudio/vite-plugin-uni": "3.0.0-3061320221209001",
"sass": "^1.56.2",
"sass-loader": "^8.0.0",
"vconsole": "^3.15.0",
"vite": "^3.2.4"
}```
vite.config.js配置如下
```import { defineConfig } from "vite";
import uni from "@dcloudio/vite-plugin-uni";
import env from "@wopan/constant/env.json";
// https://vitejs.dev/config/
const isDev = process.env.NODE_ENV === "development";
const baseProxy = {
target: env[isDev ? "development" : "production"].baseApi,
secure: false,
changeOrigin: true,
};
export default defineConfig({
optimizeDeps: ['@dcloudio/uni-ui'],
envDir:'envs',
server: {
proxy: {
"/wohome/dispatcher": baseProxy,
"/api-user/dispatcher": baseProxy,
},
},
plugins: [uni()],
});
pages.json配置如下 {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
}
},
"pages": [{ "path": "pages/index/index" }, { "path": "pages/login/index" },{"path":"pages/uploaddemo/uploaddemo"},{"path":"pages/uploadpage/uploadpage"}],
"globalStyle": {
"navigationStyle": "custom"
}
}
{
"easycom": {
"autoscan": true,
"custom": {
"^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue"
}
},
"pages": [{ "path": "pages/index/index" }, { "path": "pages/login/index" },{"path":"pages/uploaddemo/uploaddemo"},{"path":"pages/uploadpage/uploadpage"}],
"globalStyle": {
"navigationStyle": "custom"
}
}```