We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6691fbf commit 2bfeeb5Copy full SHA for 2bfeeb5
src/store/modules/template.ts
@@ -96,8 +96,17 @@ export const useTemplatesStore = defineStore('Templates', {
96
target: target.toObject(propertiesToInclude),
97
tid: this.templateId
98
}
99
+ const proxyEl: any = this.currentTemplate.objects.find(i => i.id === target.id)
100
addHistorySnapshot(data)
101
target.set({...options});
102
+ // 更新target同时更新template的对象
103
+ if (proxyEl) {
104
+ Object.keys(options).forEach((key) => {
105
+ if (key in proxyEl) {
106
+ proxyEl[key] = options[key]
107
+ }
108
+ })
109
110
if (options.filters) {
111
(target as FabricImage).applyFilters();
112
@@ -310,4 +319,4 @@ export const useTemplatesStore = defineStore('Templates', {
310
319
},
311
320
312
321
313
-})
322
+})
0 commit comments