添加页面未应用主题的bug fix

This commit is contained in:
pipipi-pikachu 2021-01-27 23:47:51 +08:00
parent 8735290052
commit fde4c3b9ac

View File

@ -13,6 +13,7 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
export default () => { export default () => {
const store = useStore<State>() const store = useStore<State>()
const slideIndex = computed(() => store.state.slideIndex) const slideIndex = computed(() => store.state.slideIndex)
const theme = computed(() => store.state.theme)
const slidesLength = computed(() => store.state.slides.length) const slidesLength = computed(() => store.state.slides.length)
const currentSlide = computed<Slide>(() => store.getters.currentSlide) const currentSlide = computed<Slide>(() => store.getters.currentSlide)
@ -51,6 +52,10 @@ export default () => {
const emptySlide = { const emptySlide = {
id: createRandomCode(8), id: createRandomCode(8),
elements: [], elements: [],
background: {
type: 'solid',
color: theme.value.backgroundColor,
},
} }
store.commit(MutationTypes.ADD_SLIDE, emptySlide) store.commit(MutationTypes.ADD_SLIDE, emptySlide)
addHistorySnapshot() addHistorySnapshot()