增加字体大小设置

This commit is contained in:
2026-07-03 11:45:16 +08:00
parent 451dd2330b
commit c3bd7960d0
28 changed files with 894 additions and 94 deletions
+14
View File
@@ -42,6 +42,20 @@ Vue.prototype.$hideLoading = function() {
uni.hideLoading()
}
// 全局字体工具
Vue.prototype.$fontSize = require('./utils/fontSize').default
// 🔥 全局混入:每个页面显示时自动应用字体设置
Vue.mixin({
onShow() {
// 从 Vuex 读取字体设置并应用到 DOM
const scale = this.$store.state.font.fontScale
if (scale && scale !== 1.0) {
this.$store.dispatch('font/applyFontScale', scale)
}
}
})
App.mpType = 'app'
const app = new Vue({