增加字体大小设置
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user