mirror of
https://github.com/kokonect-link/cherrypick
synced 2024-11-01 07:35:57 +09:00
Resolve #7096
This commit is contained in:
parent
86eb487a38
commit
9b3458fba0
@ -62,7 +62,7 @@ import FormButton from '@/components/form/button.vue';
|
||||
import FormTextarea from '@/components/form/textarea.vue';
|
||||
import FormGroup from '@/components/form/group.vue';
|
||||
|
||||
import { Theme, applyTheme, validateTheme } from '@/scripts/theme';
|
||||
import { Theme, applyTheme, validateTheme, darkTheme, lightTheme } from '@/scripts/theme';
|
||||
import { host } from '@/config';
|
||||
import * as os from '@/os';
|
||||
import { ColdDeviceStorage } from '@/store';
|
||||
@ -84,7 +84,7 @@ export default defineComponent({
|
||||
},
|
||||
theme: {
|
||||
base: 'light',
|
||||
props: {}
|
||||
props: lightTheme.props
|
||||
} as Theme,
|
||||
codeEnabled: false,
|
||||
themeCode: null,
|
||||
@ -123,7 +123,6 @@ export default defineComponent({
|
||||
|
||||
created() {
|
||||
this.$watch('theme', this.apply, { deep: true });
|
||||
|
||||
window.addEventListener('beforeunload', this.beforeunload);
|
||||
},
|
||||
|
||||
@ -159,6 +158,14 @@ export default defineComponent({
|
||||
},
|
||||
|
||||
setBgColor(color) {
|
||||
if (this.theme.base != color.kind) {
|
||||
const base = color.kind === 'dark' ? darkTheme : lightTheme;
|
||||
for (const prop of Object.keys(base.props)) {
|
||||
if (prop === 'accent') continue;
|
||||
if (prop === 'fg') continue;
|
||||
this.theme.props[prop] = base.props[prop];
|
||||
}
|
||||
}
|
||||
this.theme.base = color.kind;
|
||||
this.theme.props.bg = color.color;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user