Merge pull request #18 from Jibacat/fix_reset

fix: resetSlides方法添加background并使用当前主题
This commit is contained in:
LLzzZZ 2021-05-31 21:00:49 +08:00 committed by GitHub
commit 09f498ce24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,12 +25,17 @@ export default () => {
// 重置幻灯片
const resetSlides = () => {
store.commit(MutationTypes.UPDATE_SLIDE_INDEX, 0)
store.commit(MutationTypes.SET_ACTIVE_ELEMENT_ID_LIST, [])
store.commit(MutationTypes.SET_SLIDES, [{
const emptySlide = {
id: createRandomCode(8),
elements: [],
}])
background: {
type: 'solid',
color: theme.value.backgroundColor,
},
}
store.commit(MutationTypes.UPDATE_SLIDE_INDEX, 0)
store.commit(MutationTypes.SET_ACTIVE_ELEMENT_ID_LIST, [])
store.commit(MutationTypes.SET_SLIDES, [emptySlide])
}
/**