From 2b6c8b457595bd8d9d4b330a3bd478a188ee0b37 Mon Sep 17 00:00:00 2001 From: claw_bot Date: Thu, 12 Mar 2026 11:36:31 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=9B=86=E6=88=90uView=20Plus=202.0?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E5=BA=93=EF=BC=8C=E9=85=8D=E7=BD=AE=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=BC=95=E5=85=A5=E5=92=8Ceasycom=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=B3=A8=E5=86=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.js | 5 +++++ package-lock.json | 20 ++++++++++++++++++++ package.json | 5 +++++ pages.json | 8 +++++++- uni.scss | 3 +++ vite.config.js | 9 +++++++++ 6 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 vite.config.js diff --git a/main.js b/main.js index 1366a39..ee6ab74 100644 --- a/main.js +++ b/main.js @@ -14,6 +14,7 @@ app.$mount() // #ifdef VUE3 import { createSSRApp } from 'vue' import api from './utils/api' +import uviewPlus from 'uview-plus' console.log('🚀 应用启动,导入api模块') @@ -24,6 +25,10 @@ export function createApp() { app.config.globalProperties.$api = api console.log('✅ api已全局注册为 $api') + // 注册uView Plus + app.use(uviewPlus) + console.log('✅ uView Plus 已全局注册') + return { app } diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7031b5e --- /dev/null +++ b/package-lock.json @@ -0,0 +1,20 @@ +{ + "name": "AssetManager.UniApp", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "uview-ui": "^2.0.36" + } + }, + "node_modules/uview-ui": { + "version": "2.0.36", + "resolved": "https://registry.npmjs.org/uview-ui/-/uview-ui-2.0.36.tgz", + "integrity": "sha512-ASSZT6M8w3GTO1eFPbsgEFV0U5UujK+8pTNr+MSUbRNcRMC1u63DDTLJVeArV91kWM0bfAexK3SK9pnTqF9TtA==", + "engines": { + "HBuilderX": "^3.1.0" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..49fd105 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "dependencies": { + "uview-ui": "^2.0.36" + } +} diff --git a/pages.json b/pages.json index 74cf2c0..627dae1 100644 --- a/pages.json +++ b/pages.json @@ -68,5 +68,11 @@ } ] }, - "uniIdRouter": {} + "uniIdRouter": {}, + "easycom": { + "autoscan": true, + "custom": { + "^u-(.*)": "uview-plus/components/u-$1/u-$1.vue" + } + } } \ No newline at end of file diff --git a/uni.scss b/uni.scss index b9249e9..38697c2 100644 --- a/uni.scss +++ b/uni.scss @@ -74,3 +74,6 @@ $uni-color-subtitle: #555555; // 二级标题颜色 $uni-font-size-subtitle:26px; $uni-color-paragraph: #3F536E; // 文章段落颜色 $uni-font-size-paragraph:15px; + +/* 引入uView样式 */ +@import "uview-plus/index.scss"; diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..f232269 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,9 @@ +import { defineConfig } from 'vite' +import uni from '@dcloudio/vite-plugin-uni' + +export default defineConfig({ + plugins: [uni()], + optimizeDeps: { + include: ['uview-plus'] + } +})