Add @load feature
AruXc opened this issue · comments
mounted() {
let options = editorDefaultOptions;
if (this.includeUi) {
options = Object.assign(includeUIOptions, this.options);
}
this.editorInstance = new ImageEditor(this.$refs.tuiImageEditor, options);
this.addEventListener();
this.$emit('load', this.editorInstance) // add emit
},
need to check the instance loaded, $refs is not reliable
Just out of curiosity @AruXc - does your project also include Bootstrap-vue ^2.1 as a dependency. I ask this because we have a similar problem where our image editor is loaded in a b-modal and now doesn't show, it used to.
@nickeblewis we have a custom modal not bootstrap-vue modal but I think we have a similar problem.
Thanks @AruXc when digging deeper and doing a debug in Chrome I can see that $refs.tuiImageEditor is undefined and it was working before we updated bootstrap-vue to it's latest version. I am guessing that this hasn't worked for you at all?
The reason why $refs.imageEditor
undefined
is v-if
, so I need image editor to tell me when it loaded, and then get $refs
We wrapped ours in a settimeout for the time being which is a bit of sticky plaster fix! So keen to see your new @load feature there