Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #451 from ZenUml/fix-getPng
Browse files Browse the repository at this point in the history
Fixed getPng.
  • Loading branch information
MrCoder authored Mar 2, 2023
2 parents 2620727 + 36f1f98 commit 4a1d028
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/components/DiagramFrame/DiagramFrame.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ export default {
return this.rootContext?.title();
},
},
mounted () {
// https://stackoverflow.com/a/64429013/529187
// Expose component instance so we can access toPng and other methods.
this.$el.__vue__ = this;
},
methods: {
...mapMutations(['setScale']),
showTipsDialog() {
Expand Down
3 changes: 2 additions & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ export default class ZenUml implements IZenUml {
}

async getPng(): Promise<string> {
return this.app.$children[0].toPng();
// @ts-ignore
return this.el.children[0].__vue__.toPng();
}
}

Expand Down

0 comments on commit 4a1d028

Please sign in to comment.