第一次提交

This commit is contained in:
gxwebsoft
2023-08-04 13:04:21 +08:00
commit 7a73b38bd5
764 changed files with 166417 additions and 0 deletions

35
core/mixins/app.js Executable file
View File

@@ -0,0 +1,35 @@
import Vue from 'vue'
import { mapGetters } from 'vuex'
import store from '@/store/index'
import platform from '@/core/platform'
// 字符串驼峰转中划线
const formatToLine = value => {
return value.replace(/([A-Z])/g, '-$1').toLowerCase()
}
// 主题样式 (因小程序端不支持styleObject语法所以需要转换成字符串)
const appTheme2Str = appTheme => {
let str = ''
for (const index in appTheme) {
const name = formatToLine(index)
str += `--${name}:${appTheme[index]};`
}
return str
}
export default {
data() {
return {
platform
}
},
computed: {
...mapGetters(['appTheme']),
appThemeStyle() {
const appTheme = store.getters.appTheme
return appTheme2Str(appTheme)
}
}
}