feat: 更新项目配置与组件使用

- 在入口文件中引入uview-plus的配置,优化字体加载逻辑
- 移除manifest.json中不必要的权限描述
- 更新package.json和package-lock.json,添加开发依赖
- 调整多个组件的样式和结构,提升用户体验
- 修复部分组件的逻辑和样式问题,确保兼容性
This commit is contained in:
pikachu1995@126.com
2026-06-30 16:02:40 +08:00
parent f4337fd030
commit e871509bf5
87 changed files with 3546 additions and 1506 deletions

28
main.js
View File

@@ -1,6 +1,6 @@
import { createSSRApp } from 'vue'
import App from './App'
import uviewPlus from 'uview-plus'
import uviewPlus, { setConfig } from 'uview-plus'
import store from './store'
import config from '@/config/config'
import airBtn from '@/components/m-airbtn/index.vue'
@@ -10,9 +10,35 @@ import * as filterUtils from './utils/filters.js'
export function createApp() {
const app = createSSRApp(App)
// #ifdef MP-WEIXIN
// 微信开发者工具部分版本在输出 Vue warn 时会触发
// TypeError: Cannot read property '__global' of null自定义 handler 绕过默认路径
app.config.warnHandler = (msg, _instance, trace) => {
if (
typeof msg === 'string' &&
msg.includes('enumerating keys on a component instance')
) {
return
}
try {
console.warn(`[Vue warn]: ${msg}${trace || ''}`)
} catch (e) {
// 忽略开发者工具 console 代理异常
}
}
// #endif
app.use(store)
app.use(uviewPlus)
// uview-plus 的图标字体默认每个 u-icon 实例都会触发 uni.loadFontFace
// 导致进入页面时同一字体被反复请求。开启 loadFontOnce 后全局只加载一次。
setConfig({
config: {
loadFontOnce: true,
},
})
app.config.globalProperties.$store = store
app.config.globalProperties.$mainColor = config.mainColor
app.config.globalProperties.$lightColor = config.lightColor