mirror of
https://github.com/pipipi-pikachu/PPTist.git
synced 2025-04-15 02:20:00 +08:00
变量声明优化
This commit is contained in:
parent
38504b096a
commit
7df5b1048d
@ -86,5 +86,6 @@ export default defineComponent({
|
||||
right: 0;
|
||||
background-color: #fff;
|
||||
padding: 10px;
|
||||
z-index: -1;
|
||||
}
|
||||
</style>
|
@ -1,4 +1,4 @@
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { PPTElement, Slide } from '@/types/slides'
|
||||
@ -10,8 +10,8 @@ export default () => {
|
||||
const store = useStore<State>()
|
||||
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const activeElementList: Ref<PPTElement[]> = computed(() => store.getters.activeElementList)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const activeElementList = computed<PPTElement[]>(() => store.getters.activeElementList)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const alignElementToCanvas = (command: ElementAlignCommand) => {
|
||||
const viewportWidth = VIEWPORT_SIZE
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { PPTElement, Slide } from '@/types/slides'
|
||||
@ -8,8 +8,8 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
||||
export default () => {
|
||||
const store = useStore<State>()
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const activeElementList: Ref<PPTElement[]> = computed(() => store.getters.activeElementList)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const activeElementList = computed<PPTElement[]>(() => store.getters.activeElementList)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { PPTElement } from '@/types/slides'
|
||||
@ -11,7 +11,7 @@ import useDeleteElement from './useDeleteElement'
|
||||
export default () => {
|
||||
const store = useStore<State>()
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const activeElementList: Ref<PPTElement[]> = computed(() => store.getters.activeElementList)
|
||||
const activeElementList = computed<PPTElement[]>(() => store.getters.activeElementList)
|
||||
|
||||
const { pasteTextClipboardData } = usePasteTextClipboardData()
|
||||
const { deleteElement } = useDeleteElement()
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { Slide } from '@/types/slides'
|
||||
@ -7,7 +7,7 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
||||
export default () => {
|
||||
const store = useStore<State>()
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { useStore } from 'vuex'
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { PPTElement, Slide } from '@/types/slides'
|
||||
import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
||||
@ -7,7 +7,7 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
||||
export default () => {
|
||||
const store = useStore<State>()
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { Slide } from '@/types/slides'
|
||||
@ -8,7 +8,7 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
||||
export default () => {
|
||||
const store = useStore<State>()
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { PPTElement, Slide } from '@/types/slides'
|
||||
@ -7,7 +7,7 @@ import useHistorySnapshot from '@/hooks/useHistorySnapshot'
|
||||
|
||||
export default () => {
|
||||
const store = useStore<State>()
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { computed, Ref } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { decrypt } from '@/utils/crypto'
|
||||
@ -13,7 +13,7 @@ interface PasteTextClipboardDataOptions {
|
||||
|
||||
export default () => {
|
||||
const store = useStore<State>()
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { Slide } from '@/types/slides'
|
||||
|
||||
export default () => {
|
||||
const store = useStore<State>()
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const selectAllElement = () => {
|
||||
const unlockedElements = currentSlide.value.elements.filter(el => !el.lock)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Ref, computed } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
import { Slide } from '@/types/slides'
|
||||
@ -14,7 +14,7 @@ export default () => {
|
||||
const store = useStore<State>()
|
||||
const slideIndex = computed(() => store.state.slideIndex)
|
||||
const slidesLength = computed(() => store.state.slides.length)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const { pasteTextClipboardData } = usePasteTextClipboardData()
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
@ -28,7 +28,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, onMounted, reactive, Ref, ref } from 'vue'
|
||||
import { computed, defineComponent, onMounted, reactive, ref } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
|
||||
@ -36,7 +36,7 @@ export default defineComponent({
|
||||
name: 'element-create-selection',
|
||||
setup(props, { emit }) {
|
||||
const store = useStore<State>()
|
||||
const ctrlOrShiftKeyActive: Ref<boolean> = computed(() => store.getters.ctrlOrShiftKeyActive)
|
||||
const ctrlOrShiftKeyActive = computed<boolean>(() => store.getters.ctrlOrShiftKeyActive)
|
||||
const creatingElement = computed(() => store.state.creatingElement)
|
||||
|
||||
const start = ref<[number, number] | null>(null)
|
||||
|
@ -15,7 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, computed, Ref } from 'vue'
|
||||
import { defineComponent, computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import tinycolor from 'tinycolor2'
|
||||
import { State } from '@/store'
|
||||
@ -27,7 +27,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const canvasScale = computed(() => store.state.canvasScale)
|
||||
const background: Ref<SlideBackground | undefined> = computed(() => store.getters.currentSlide.background)
|
||||
const background = computed<SlideBackground | undefined>(() => store.getters.currentSlide.background)
|
||||
|
||||
const gridColor = computed(() => {
|
||||
if(!background.value || background.value.type === 'image') return 'rgba(100, 100, 100, 0.5)'
|
||||
|
@ -30,7 +30,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, PropType, computed, Ref } from 'vue'
|
||||
import { defineComponent, PropType, computed } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State } from '@/store'
|
||||
import { ElementTypes, PPTElement, Slide } from '@/types/slides'
|
||||
@ -82,7 +82,7 @@ export default defineComponent({
|
||||
const store = useStore<State>()
|
||||
const canvasScale = computed(() => store.state.canvasScale)
|
||||
const toolbarState = computed(() => store.state.toolbarState)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const currentOperateComponent = computed(() => {
|
||||
const elementTypeMap = {
|
||||
|
@ -8,7 +8,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { Ref, computed, defineComponent } from 'vue'
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State } from '@/store'
|
||||
import { SlideBackground } from '@/types/slides'
|
||||
@ -23,7 +23,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const showGridLines = computed(() => store.state.showGridLines)
|
||||
const background: Ref<SlideBackground | undefined> = computed(() => store.getters.currentSlide.background)
|
||||
const background = computed<SlideBackground | undefined>(() => store.getters.currentSlide.background)
|
||||
|
||||
const { backgroundStyle } = useSlideBackgroundStyle(background)
|
||||
|
||||
|
@ -91,7 +91,7 @@ export default (
|
||||
) => {
|
||||
const store = useStore<State>()
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const ctrlOrShiftKeyActive: Ref<boolean> = computed(() => store.getters.ctrlOrShiftKeyActive)
|
||||
const ctrlOrShiftKeyActive = computed<boolean>(() => store.getters.ctrlOrShiftKeyActive)
|
||||
const canvasScale = computed(() => store.state.canvasScale)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
@ -13,7 +13,7 @@ export default (
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const handleElementId = computed(() => store.state.handleElementId)
|
||||
const editorAreaFocus = computed(() => store.state.editorAreaFocus)
|
||||
const ctrlOrShiftKeyActive: Ref<boolean> = computed(() => store.getters.ctrlOrShiftKeyActive)
|
||||
const ctrlOrShiftKeyActive = computed<boolean>(() => store.getters.ctrlOrShiftKeyActive)
|
||||
|
||||
const selectElement = (e: MouseEvent, element: PPTElement, canMove = true) => {
|
||||
if(!editorAreaFocus.value) store.commit(MutationTypes.SET_EDITORAREA_FOCUS, true)
|
||||
|
@ -75,7 +75,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, provide, Ref, ref, watch, watchEffect } from 'vue'
|
||||
import { computed, defineComponent, provide, ref, watch, watchEffect } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import throttle from 'lodash/throttle'
|
||||
import { State, MutationTypes } from '@/store'
|
||||
@ -125,7 +125,7 @@ export default defineComponent({
|
||||
const handleElementId = computed(() => store.state.handleElementId)
|
||||
const editorAreaFocus = computed(() => store.state.editorAreaFocus)
|
||||
const ctrlKeyState = computed(() => store.state.ctrlKeyState)
|
||||
const ctrlOrShiftKeyActive: Ref<boolean> = computed(() => store.getters.ctrlOrShiftKeyActive)
|
||||
const ctrlOrShiftKeyActive = computed<boolean>(() => store.getters.ctrlOrShiftKeyActive)
|
||||
|
||||
const viewportRef = ref<HTMLElement>()
|
||||
const isShowGridLines = ref(false)
|
||||
@ -134,7 +134,7 @@ export default defineComponent({
|
||||
const activeGroupElementId = ref('')
|
||||
watch(handleElementId, () => activeGroupElementId.value = '')
|
||||
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
const elementList = ref<PPTElement[]>([])
|
||||
const setLocalElementList = () => {
|
||||
elementList.value = currentSlide.value ? JSON.parse(JSON.stringify(currentSlide.value.elements)) : []
|
||||
|
@ -67,7 +67,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref, Ref } from 'vue'
|
||||
import { computed, defineComponent, ref } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTAnimation, PPTElement, Slide } from '@/types/slides'
|
||||
@ -91,9 +91,9 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTElement> = computed(() => store.getters.handleElement)
|
||||
const currentSlideAnimations: Ref<PPTAnimation[] | null> = computed(() => store.getters.currentSlideAnimations)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const handleElement = computed<PPTElement>(() => store.getters.handleElement)
|
||||
const currentSlideAnimations = computed<PPTAnimation[] | null>(() => store.getters.currentSlideAnimations)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const hoverPreviewAnimation = ref('')
|
||||
const animationPoolVisible = ref(false)
|
||||
|
@ -133,7 +133,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref, Ref, watch } from 'vue'
|
||||
import { computed, defineComponent, ref, watch } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import round from 'lodash/round'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
@ -147,7 +147,7 @@ export default defineComponent({
|
||||
name: 'element-positopn-panel',
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTElement>(() => store.getters.handleElement)
|
||||
|
||||
const left = ref(0)
|
||||
const top = ref(0)
|
||||
|
@ -118,7 +118,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref, ref, watch } from 'vue'
|
||||
import { computed, defineComponent, ref, watch } from 'vue'
|
||||
import { IBarChartOptions, ILineChartOptions, IPieChartOptions } from 'chartist'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
@ -139,7 +139,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTChartElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTChartElement>(() => store.getters.handleElement)
|
||||
|
||||
const chartDataEditorVisible = ref(false)
|
||||
const themePoolVisible = ref(false)
|
||||
|
@ -92,7 +92,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref, Ref, watch } from 'vue'
|
||||
import { computed, defineComponent, ref, watch } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTImageElement } from '@/types/slides'
|
||||
@ -165,7 +165,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTImageElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTImageElement>(() => store.getters.handleElement)
|
||||
|
||||
const clipPanelVisible = ref(false)
|
||||
|
||||
@ -174,7 +174,7 @@ export default defineComponent({
|
||||
y: 0,
|
||||
})
|
||||
|
||||
const filterOptions: Ref<FilterOption[]> = ref(JSON.parse(JSON.stringify(defaultFilters)))
|
||||
const filterOptions = ref<FilterOption[]>(JSON.parse(JSON.stringify(defaultFilters)))
|
||||
|
||||
watch(handleElement, () => {
|
||||
if(!handleElement.value) return
|
||||
|
@ -63,7 +63,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref } from 'vue'
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTLineElement } from '@/types/slides'
|
||||
@ -80,7 +80,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTLineElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTLineElement>(() => store.getters.handleElement)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
|
||||
|
@ -78,7 +78,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, ref, Ref, watch } from 'vue'
|
||||
import { computed, defineComponent, ref, watch } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTShapeElement, ShapeGradient } from '@/types/slides'
|
||||
@ -99,7 +99,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTShapeElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTShapeElement>(() => store.getters.handleElement)
|
||||
|
||||
const fill = ref<string>()
|
||||
const gradient = ref<ShapeGradient>()
|
||||
|
@ -199,7 +199,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, onUnmounted, Ref, ref, watch } from 'vue'
|
||||
import { computed, defineComponent, onUnmounted, ref, watch } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTTextElement } from '@/types/slides'
|
||||
@ -220,7 +220,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTTextElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTTextElement>(() => store.getters.handleElement)
|
||||
|
||||
const fill = ref<string>()
|
||||
const lineHeight = ref<number>()
|
||||
|
@ -8,7 +8,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref } from 'vue'
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State } from '@/store'
|
||||
import { ElementTypes, PPTElement } from '@/types/slides'
|
||||
@ -23,7 +23,7 @@ export default defineComponent({
|
||||
name: 'element-style-panel',
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTElement>(() => store.getters.handleElement)
|
||||
|
||||
const currentPanelComponent = computed(() => {
|
||||
if(!handleElement.value) return null
|
||||
|
@ -33,7 +33,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref } from 'vue'
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTElement, Slide } from '@/types/slides'
|
||||
@ -47,8 +47,8 @@ export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const activeElementIdList = computed(() => store.state.activeElementIdList)
|
||||
const activeElementList: Ref<PPTElement[]> = computed(() => store.getters.activeElementList)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const activeElementList = computed<PPTElement[]>(() => store.getters.activeElementList)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const { addHistorySnapshot } = useHistorySnapshot()
|
||||
const { combineElements, uncombineElements } = useCombineElement()
|
||||
|
@ -17,7 +17,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref } from 'vue'
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { Slide } from '@/types/slides'
|
||||
@ -28,7 +28,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const slides = computed(() => store.state.slides)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const currentTurningMode = computed(() => currentSlide.value.turningMode || 'slideY')
|
||||
|
||||
|
@ -99,7 +99,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref } from 'vue'
|
||||
import { computed, defineComponent } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { Slide, SlideBackground } from '@/types/slides'
|
||||
@ -116,7 +116,7 @@ export default defineComponent({
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const slides = computed(() => store.state.slides)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const background = computed(() => {
|
||||
if(!currentSlide.value.background) {
|
||||
|
@ -15,7 +15,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref, ref, watch } from 'vue'
|
||||
import { computed, defineComponent, ref, watch } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTElement } from '@/types/slides'
|
||||
@ -25,7 +25,7 @@ export default defineComponent({
|
||||
name: 'element-opacity',
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTElement>(() => store.getters.handleElement)
|
||||
|
||||
const opacity = ref<number>()
|
||||
|
||||
|
@ -46,7 +46,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref, ref, watch } from 'vue'
|
||||
import { computed, defineComponent, ref, watch } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTElement, PPTElementOutline } from '@/types/slides'
|
||||
@ -61,7 +61,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTElement>(() => store.getters.handleElement)
|
||||
|
||||
const outline = ref<PPTElementOutline>()
|
||||
const hasOutline = ref(false)
|
||||
|
@ -57,7 +57,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, Ref, ref, watch } from 'vue'
|
||||
import { computed, defineComponent, ref, watch } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
import { PPTElement, PPTElementShadow } from '@/types/slides'
|
||||
@ -72,7 +72,7 @@ export default defineComponent({
|
||||
},
|
||||
setup() {
|
||||
const store = useStore<State>()
|
||||
const handleElement: Ref<PPTElement> = computed(() => store.getters.handleElement)
|
||||
const handleElement = computed<PPTElement>(() => store.getters.handleElement)
|
||||
|
||||
const shadow = ref<PPTElementShadow>()
|
||||
const hasShadow = ref(false)
|
||||
|
@ -14,7 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, PropType, Ref } from 'vue'
|
||||
import { computed, defineComponent, PropType } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import { State } from '@/store'
|
||||
import { ElementTypes, PPTElement, Slide } from '@/types/slides'
|
||||
@ -54,7 +54,7 @@ export default defineComponent({
|
||||
})
|
||||
|
||||
const store = useStore<State>()
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const needWaitAnimation = computed(() => {
|
||||
const animations = currentSlide.value.animations || []
|
||||
|
@ -60,7 +60,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { computed, defineComponent, onMounted, onUnmounted, provide, Ref, ref } from 'vue'
|
||||
import { computed, defineComponent, onMounted, onUnmounted, provide, ref } from 'vue'
|
||||
import { useStore } from 'vuex'
|
||||
import throttle from 'lodash/throttle'
|
||||
import { MutationTypes, State } from '@/store'
|
||||
@ -86,7 +86,7 @@ export default defineComponent({
|
||||
const store = useStore<State>()
|
||||
const slides = computed(() => store.state.slides)
|
||||
const slideIndex = computed(() => store.state.slideIndex)
|
||||
const currentSlide: Ref<Slide> = computed(() => store.getters.currentSlide)
|
||||
const currentSlide = computed<Slide>(() => store.getters.currentSlide)
|
||||
|
||||
const slideWidth = ref(0)
|
||||
const slideHeight = ref(0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user