vue-photo-preview
vue-photo-preview copied to clipboard
增加 appendToEl
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch [email protected]
for the project I'm working on.
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.