Skip to content

Commit

Permalink
更新类型
Browse files Browse the repository at this point in the history
  • Loading branch information
more-strive committed Jun 19, 2024
1 parent ed2545d commit ceb1a20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/store/modules/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Template, CanvasElement, ImageElement, GroupElement, RectElement } from
import { Object as FabricObject, SerializedImageProps, Image, Group } from 'fabric'
import { WorkSpaceDrawType, propertiesToInclude } from '@/configs/canvas'
import { useMainStore } from './main'
import { IUIInputData } from '@leafer-ui/interface'
import { ElementNames } from '@/types/elements'
import { ElLoading } from 'element-plus'
import { CanvasTypes } from '@/enums'
Expand All @@ -23,7 +24,7 @@ interface UpdateElementData {
}

export interface TemplatesState {
templates: Template[]
templates: IUIInputData[]
templateIndex: number
}

Expand Down Expand Up @@ -77,7 +78,7 @@ export const useTemplatesStore = defineStore('Templates', {
modifedElement() {
const [ canvas ] = useCanvas()
const { addHistorySnapshot } = useHistorySnapshot()
const result = canvas.tree.findOne(`#${CanvasTypes.WorkSpaceDrawType}`).toJSON() as Template
const result = canvas.tree.findOne(`#${CanvasTypes.WorkSpaceDrawType}`).toJSON()
this.templates[this.templateIndex] = result
addHistorySnapshot()
},
Expand Down

0 comments on commit ceb1a20

Please sign in to comment.