- 替换所有文件中的品牌名称引用,包括App.vue、pages.json、uni.scss等 - 更新全局样式、导航栏标题和组件中的文案显示 - 修改分享功能中的应用名称显示 - 调整聊天页面的输入栏键盘适配逻辑 - 在多个页面组件中添加事件发射声明以支持交互功能
29 lines
633 B
JavaScript
29 lines
633 B
JavaScript
/* 碰盏日记 - 主题混入 (Theme Mixin)
|
|
* 每个页面混入此mixin,自动在onShow时刷新日夜主题
|
|
* 页面根视图需绑定 :class="themeClass"
|
|
*/
|
|
import { getCurrentTheme, applyTheme } from './utils'
|
|
|
|
export default {
|
|
data() {
|
|
return {
|
|
themeClass: 'theme-dark',
|
|
currentTheme: 'dark'
|
|
}
|
|
},
|
|
created() {
|
|
this._refreshTheme()
|
|
},
|
|
onShow() {
|
|
this._refreshTheme()
|
|
},
|
|
methods: {
|
|
_refreshTheme() {
|
|
const theme = getCurrentTheme()
|
|
this.currentTheme = theme
|
|
this.themeClass = theme === 'light' ? 'theme-light' : 'theme-dark'
|
|
applyTheme(theme)
|
|
}
|
|
}
|
|
}
|