PPTist/src/App.vue
pipipi-pikachu 29db40288e vuex优化
2021-01-29 10:32:32 +08:00

39 lines
754 B
Vue

<template>
<Editor v-if="!screening" />
<Screen v-else />
</template>
<script lang="ts">
import { computed, defineComponent, onMounted } from 'vue'
import { MutationTypes, ActionTypes, useStore } from '@/store'
import Editor from './views/Editor/index.vue'
import Screen from './views/Screen/index.vue'
export default defineComponent({
name: 'app',
components: {
Editor,
Screen,
},
setup() {
const store = useStore()
const screening = computed(() => store.state.screening)
onMounted(() => {
store.commit(MutationTypes.SET_AVAILABLE_FONTS)
store.dispatch(ActionTypes.INIT_SNAPSHOT_DATABASE)
})
return {
screening,
}
},
})
</script>
<style lang="scss">
#app {
height: 100%;
}
</style>