Open Lin-Kangjing opened 1 year ago
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch vue-photo-preview@1.1.3 for the project I'm working on.
vue-photo-preview@1.1.3
Here is the diff that solved my problem:
diff --git a/node_modules/vue-photo-preview/src/lib/index.js b/node_modules/vue-photo-preview/src/lib/index.js index 67ec150..447ce10 100644 --- a/node_modules/vue-photo-preview/src/lib/index.js +++ b/node_modules/vue-photo-preview/src/lib/index.js @@ -8,7 +8,12 @@ var vuePhotoPreview ={ var opts=opts||{} if (!$preview) { $preview = new Preview({el: document.createElement('div')}) - document.body.appendChild($preview.$el) + if(opts.appendToEl){ + opts.appendToEl.appendChild($preview.$el) + }else{ + document.body.appendChild($preview.$el) + } + } let eventName,eventCallback Vue.prototype.$preview={
This issue body was partially generated by patch-package.
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
vue-photo-preview@1.1.3
for the project I'm working on.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.