perf: 代码优化

This commit is contained in:
zxc 2025-03-15 17:29:06 +08:00
parent 74943c3d2b
commit 82dc18f1f1
3 changed files with 9 additions and 3 deletions

View File

@ -10,11 +10,17 @@
</template>
<script lang="ts" setup>
import { computed } from 'vue'
import Button from './Button.vue'
defineProps<{
const props = defineProps<{
colors: string[]
}>()
const colors = computed(() => {
if (props.colors.length > 12) return props.colors.slice(0, 12)
return props.colors
})
</script>
<style lang="scss" scoped>

View File

@ -12,7 +12,7 @@ interface ThemeValueWithArea {
export default () => {
const slidesStore = useSlidesStore()
const { slides, currentSlide, theme } = storeToRefs(slidesStore)
const { slides, theme } = storeToRefs(slidesStore)
const { addHistorySnapshot } = useHistorySnapshot()

View File

@ -3,7 +3,7 @@
<div class="left">
<Popover trigger="click" placement="bottom-start" v-model:value="mainMenuVisible">
<template #content>
<PopoverMenuItem @click="openAIPPTDialog(); mainMenuVisible = false">AI 生成 PPT测试版</PopoverMenuItem>
<PopoverMenuItem @click="openAIPPTDialog(); mainMenuVisible = false">AI 生成 PPT</PopoverMenuItem>
<FileInput accept="application/vnd.openxmlformats-officedocument.presentationml.presentation" @change="files => {
importPPTXFile(files)
mainMenuVisible = false