vue-mount-plugin 2.1.0 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +0,0 @@
1
- /*!
2
- * vue-mount-plugin v2.1.0
3
- * A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
4
- * (c) 2021-2023 saqqdy <saqqdy@qq.com>
5
- * Released under the MIT License.
6
- */
7
- this.VueMount=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=function(t){return t&&t.Math==Math&&t},r=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof e&&e)||function(){return this}()||Function("return this")(),o={},i=function(t){try{return!!t()}catch(t){return!0}},u=!i((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=!i((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),a=c,f=Function.prototype.call,s=a?f.bind(f):function(){return f.apply(f,arguments)},l={},p={}.propertyIsEnumerable,y=Object.getOwnPropertyDescriptor,b=y&&!p.call({1:2},1);l.f=b?function(t){var e=y(this,t);return!!e&&e.enumerable}:p;var h,g,d=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},v=c,m=Function.prototype,O=m.call,S=v&&m.bind.bind(O,O),w=v?S:function(t){return function(){return O.apply(t,arguments)}},j=w,P=j({}.toString),E=j("".slice),M=i,N=function(t){return E(P(t),8,-1)},T=Object,x=w("".split),C=M((function(){return!T("z").propertyIsEnumerable(0)}))?function(t){return"String"==N(t)?x(t,""):T(t)}:T,D=function(t){return null==t},I=D,k=TypeError,F=function(t){if(I(t))throw k("Can't call method on "+t);return t},L=C,_=F,V=function(t){return L(_(t))},A="object"==typeof document&&document.all,z={all:A,IS_HTMLDDA:void 0===A&&void 0!==A},R=z.all,$=z.IS_HTMLDDA?function(t){return"function"==typeof t||t===R}:function(t){return"function"==typeof t},q=$,B=z.all,G=z.IS_HTMLDDA?function(t){return"object"==typeof t?null!==t:q(t)||t===B}:function(t){return"object"==typeof t?null!==t:q(t)},H=r,W=$,U=function(t){return W(t)?t:void 0},K=function(t,e){return arguments.length<2?U(H[t]):H[t]&&H[t][e]},X=w({}.isPrototypeOf),Y=r,J="undefined"!=typeof navigator&&String(navigator.userAgent)||"",Q=Y.process,Z=Y.Deno,tt=Q&&Q.versions||Z&&Z.version,et=tt&&tt.v8;et&&(g=(h=et.split("."))[0]>0&&h[0]<4?1:+(h[0]+h[1])),!g&&J&&(!(h=J.match(/Edge\/(\d+)/))||h[1]>=74)&&(h=J.match(/Chrome\/(\d+)/))&&(g=+h[1]);var nt=g,rt=i,ot=!!Object.getOwnPropertySymbols&&!rt((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&nt&&nt<41})),it=ot&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ut=K,ct=$,at=X,ft=Object,st=it?function(t){return"symbol"==typeof t}:function(t){var e=ut("Symbol");return ct(e)&&at(e.prototype,ft(t))},lt=String,pt=$,yt=function(t){try{return lt(t)}catch(t){return"Object"}},bt=TypeError,ht=function(t){if(pt(t))return t;throw bt(yt(t)+" is not a function")},gt=D,dt=s,vt=$,mt=G,Ot=TypeError,St={},wt={get exports(){return St},set exports(t){St=t}},jt=r,Pt=Object.defineProperty,Et=function(t,e){try{Pt(jt,t,{value:e,configurable:!0,writable:!0})}catch(n){jt[t]=e}return e},Mt=Et,Nt="__core-js_shared__",Tt=r[Nt]||Mt(Nt,{}),xt=Tt;(wt.exports=function(t,e){return xt[t]||(xt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.29.1",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ct=F,Dt=Object,It=function(t){return Dt(Ct(t))},kt=It,Ft=w({}.hasOwnProperty),Lt=Object.hasOwn||function(t,e){return Ft(kt(t),e)},_t=w,Vt=0,At=Math.random(),zt=_t(1..toString),Rt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+zt(++Vt+At,36)},$t=St,qt=Lt,Bt=Rt,Gt=ot,Ht=it,Wt=r.Symbol,Ut=$t("wks"),Kt=Ht?Wt.for||Wt:Wt&&Wt.withoutSetter||Bt,Xt=s,Yt=G,Jt=st,Qt=function(t,e){var n=t[e];return gt(n)?void 0:ht(n)},Zt=function(t,e){var n,r;if("string"===e&&vt(n=t.toString)&&!mt(r=dt(n,t)))return r;if(vt(n=t.valueOf)&&!mt(r=dt(n,t)))return r;if("string"!==e&&vt(n=t.toString)&&!mt(r=dt(n,t)))return r;throw Ot("Can't convert object to primitive value")},te=TypeError,ee=function(t){return qt(Ut,t)||(Ut[t]=Gt&&qt(Wt,t)?Wt[t]:Kt("Symbol."+t)),Ut[t]}("toPrimitive"),ne=function(t,e){if(!Yt(t)||Jt(t))return t;var n,r=Qt(t,ee);if(r){if(void 0===e&&(e="default"),n=Xt(r,t,e),!Yt(n)||Jt(n))return n;throw te("Can't convert object to primitive value")}return void 0===e&&(e="number"),Zt(t,e)},re=st,oe=function(t){var e=ne(t,"string");return re(e)?e:e+""},ie=G,ue=r.document,ce=ie(ue)&&ie(ue.createElement),ae=function(t){return ce?ue.createElement(t):{}},fe=!u&&!i((function(){return 7!=Object.defineProperty(ae("div"),"a",{get:function(){return 7}}).a})),se=u,le=s,pe=l,ye=d,be=V,he=oe,ge=Lt,de=fe,ve=Object.getOwnPropertyDescriptor;o.f=se?ve:function(t,e){if(t=be(t),e=he(e),de)try{return ve(t,e)}catch(t){}if(ge(t,e))return ye(!le(pe.f,t,e),t[e])};var me={},Oe=u&&i((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Se=G,we=String,je=TypeError,Pe=function(t){if(Se(t))return t;throw je(we(t)+" is not an object")},Ee=u,Me=fe,Ne=Oe,Te=Pe,xe=oe,Ce=TypeError,De=Object.defineProperty,Ie=Object.getOwnPropertyDescriptor,ke="enumerable",Fe="configurable",Le="writable";me.f=Ee?Ne?function(t,e,n){if(Te(t),e=xe(e),Te(n),"function"==typeof t&&"prototype"===e&&"value"in n&&Le in n&&!n[Le]){var r=Ie(t,e);r&&r[Le]&&(t[e]=n.value,n={configurable:Fe in n?n[Fe]:r[Fe],enumerable:ke in n?n[ke]:r[ke],writable:!1})}return De(t,e,n)}:De:function(t,e,n){if(Te(t),e=xe(e),Te(n),Me)try{return De(t,e,n)}catch(t){}if("get"in n||"set"in n)throw Ce("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var _e=me,Ve=d,Ae=u?function(t,e,n){return _e.f(t,e,Ve(1,n))}:function(t,e,n){return t[e]=n,t},ze={},Re={get exports(){return ze},set exports(t){ze=t}},$e=u,qe=Lt,Be=Function.prototype,Ge=$e&&Object.getOwnPropertyDescriptor,He=qe(Be,"name"),We={EXISTS:He,PROPER:He&&"something"===function(){}.name,CONFIGURABLE:He&&(!$e||$e&&Ge(Be,"name").configurable)},Ue=$,Ke=Tt,Xe=w(Function.toString);Ue(Ke.inspectSource)||(Ke.inspectSource=function(t){return Xe(t)});var Ye,Je,Qe,Ze=Ke.inspectSource,tn=$,en=r.WeakMap,nn=tn(en)&&/native code/.test(String(en)),rn=Rt,on=St("keys"),un={},cn=nn,an=r,fn=G,sn=Ae,ln=Lt,pn=Tt,yn=function(t){return on[t]||(on[t]=rn(t))},bn=un,hn="Object already initialized",gn=an.TypeError,dn=an.WeakMap;if(cn||pn.state){var vn=pn.state||(pn.state=new dn);vn.get=vn.get,vn.has=vn.has,vn.set=vn.set,Ye=function(t,e){if(vn.has(t))throw gn(hn);return e.facade=t,vn.set(t,e),e},Je=function(t){return vn.get(t)||{}},Qe=function(t){return vn.has(t)}}else{var mn=yn("state");bn[mn]=!0,Ye=function(t,e){if(ln(t,mn))throw gn(hn);return e.facade=t,sn(t,mn,e),e},Je=function(t){return ln(t,mn)?t[mn]:{}},Qe=function(t){return ln(t,mn)}}var On={set:Ye,get:Je,has:Qe,enforce:function(t){return Qe(t)?Je(t):Ye(t,{})},getterFor:function(t){return function(e){var n;if(!fn(e)||(n=Je(e)).type!==t)throw gn("Incompatible receiver, "+t+" required");return n}}},Sn=w,wn=i,jn=$,Pn=Lt,En=u,Mn=We.CONFIGURABLE,Nn=Ze,Tn=On.enforce,xn=On.get,Cn=String,Dn=Object.defineProperty,In=Sn("".slice),kn=Sn("".replace),Fn=Sn([].join),Ln=En&&!wn((function(){return 8!==Dn((function(){}),"length",{value:8}).length})),_n=String(String).split("String"),Vn=Re.exports=function(t,e,n){"Symbol("===In(Cn(e),0,7)&&(e="["+kn(Cn(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!Pn(t,"name")||Mn&&t.name!==e)&&(En?Dn(t,"name",{value:e,configurable:!0}):t.name=e),Ln&&n&&Pn(n,"arity")&&t.length!==n.arity&&Dn(t,"length",{value:n.arity});try{n&&Pn(n,"constructor")&&n.constructor?En&&Dn(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=Tn(t);return Pn(r,"source")||(r.source=Fn(_n,"string"==typeof e?e:"")),t};Function.prototype.toString=Vn((function(){return jn(this)&&xn(this).source||Nn(this)}),"toString");var An=$,zn=me,Rn=ze,$n=Et,qn={},Bn=Math.ceil,Gn=Math.floor,Hn=Math.trunc||function(t){var e=+t;return(e>0?Gn:Bn)(e)},Wn=function(t){var e=+t;return e!=e||0===e?0:Hn(e)},Un=Wn,Kn=Math.max,Xn=Math.min,Yn=Wn,Jn=Math.min,Qn=function(t){return t>0?Jn(Yn(t),9007199254740991):0},Zn=V,tr=function(t,e){var n=Un(t);return n<0?Kn(n+e,0):Xn(n,e)},er=function(t){return Qn(t.length)},nr=function(t){return function(e,n,r){var o,i=Zn(e),u=er(i),c=tr(r,u);if(t&&n!=n){for(;u>c;)if((o=i[c++])!=o)return!0}else for(;u>c;c++)if((t||c in i)&&i[c]===n)return t||c||0;return!t&&-1}},rr={includes:nr(!0),indexOf:nr(!1)},or=Lt,ir=V,ur=rr.indexOf,cr=un,ar=w([].push),fr=function(t,e){var n,r=ir(t),o=0,i=[];for(n in r)!or(cr,n)&&or(r,n)&&ar(i,n);for(;e.length>o;)or(r,n=e[o++])&&(~ur(i,n)||ar(i,n));return i},sr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],lr=fr,pr=sr.concat("length","prototype");qn.f=Object.getOwnPropertyNames||function(t){return lr(t,pr)};var yr={};yr.f=Object.getOwnPropertySymbols;var br=K,hr=qn,gr=yr,dr=Pe,vr=w([].concat),mr=br("Reflect","ownKeys")||function(t){var e=hr.f(dr(t)),n=gr.f;return n?vr(e,n(t)):e},Or=Lt,Sr=mr,wr=o,jr=me,Pr=i,Er=$,Mr=/#|\.prototype\./,Nr=function(t,e){var n=xr[Tr(t)];return n==Dr||n!=Cr&&(Er(e)?Pr(e):!!e)},Tr=Nr.normalize=function(t){return String(t).replace(Mr,".").toLowerCase()},xr=Nr.data={},Cr=Nr.NATIVE="N",Dr=Nr.POLYFILL="P",Ir=Nr,kr=r,Fr=o.f,Lr=Ae,_r=function(t,e,n,r){r||(r={});var o=r.enumerable,i=void 0!==r.name?r.name:e;if(An(n)&&Rn(n,i,r),r.global)o?t[e]=n:$n(e,n);else{try{r.unsafe?t[e]&&(o=!0):delete t[e]}catch(t){}o?t[e]=n:zn.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Vr=Et,Ar=function(t,e,n){for(var r=Sr(e),o=jr.f,i=wr.f,u=0;u<r.length;u++){var c=r[u];Or(t,c)||n&&Or(n,c)||o(t,c,i(e,c))}},zr=Ir,Rr=fr,$r=sr,qr=Object.keys||function(t){return Rr(t,$r)},Br=u,Gr=w,Hr=s,Wr=i,Ur=qr,Kr=yr,Xr=l,Yr=It,Jr=C,Qr=Object.assign,Zr=Object.defineProperty,to=Gr([].concat),eo=!Qr||Wr((function(){if(Br&&1!==Qr({b:1},Qr(Zr({},"a",{enumerable:!0,get:function(){Zr(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!=Qr({},t)[n]||Ur(Qr({},e)).join("")!=r}))?function(t,e){for(var n=Yr(t),r=arguments.length,o=1,i=Kr.f,u=Xr.f;r>o;)for(var c,a=Jr(arguments[o++]),f=i?to(Ur(a),i(a)):Ur(a),s=f.length,l=0;s>l;)c=f[l++],Br&&!Hr(u,a,c)||(n[c]=a[c]);return n}:Qr,no=eo;return function(t,e){var n,r,o,i,u,c=t.target,a=t.global,f=t.stat;if(n=a?kr:f?kr[c]||Vr(c,{}):(kr[c]||{}).prototype)for(r in e){if(i=e[r],o=t.dontCallGetSet?(u=Fr(n,r))&&u.value:n[r],!zr(a?r:c+(f?".":"#")+r,t.forced)&&void 0!==o){if(typeof i==typeof o)continue;Ar(i,o)}(t.sham||o&&o.sham)&&Lr(i,"sham",!0),_r(n,r,i,t)}}({target:"Object",stat:!0,arity:2,forced:Object.assign!==no},{assign:no}),function(){function e(t,e){if(void 0===e&&(e={}),this.vNode=null,this.options={},this.seed=1,"undefined"==typeof document)throw new Error("This plugin works in browser");this.options=e,this.target=("string"==typeof e.target?document.querySelector(e.target):e.target)||document.createElement(e.tagName||"div"),this.vNode=this.createVM(t,e)}return e.prototype.createVM=function(e,n){var r,o=void 0===n?{}:n,i=o.props,u=o.children,c=o.patchFlag,a=o.dynamicProps,f=o.isBlockNode,s=o.app,l=o.context,p=o.parent;return t.isVue2?((r=new(t.Vue2.extend(Object.assign({},l||{},e)))({parent:p,propsData:i})).id="mount-plugin-"+this.seed++,r):(r=t.createVNode(e,i,u,c,a,f),(null==s?void 0:s._context)&&(r.appContext=s._context),r)},e.prototype.mount=function(){!this.options.target&&document.body.appendChild(this.target),t.isVue2?this.vNode&&this.vNode.$mount(this.target):t.render(this.vNode,this.target)},e.prototype.unmount=function(){t.isVue2?(this.vNode.$destroy(),document.body.removeChild(this.vNode.$el)):(t.render(null,this.target),document.body.removeChild(this.target)),this.vNode=null,this.target=null},e}()}(VueDemi);
@@ -1,64 +0,0 @@
1
- import 'core-js/modules/es.object.assign.js';
2
- import { isVue2, Vue2, createVNode, render } from 'vue-demi';
3
-
4
- var Mount = function () {
5
- function Mount(component, options) {
6
- if (options === void 0) {
7
- options = {};
8
- }
9
- this.vNode = null;
10
- this.options = {};
11
- this.seed = 1;
12
- if (typeof document === 'undefined') throw new Error('This plugin works in browser');
13
- this.options = options;
14
- this.target = (typeof options.target === 'string' ? document.querySelector(options.target) : options.target) || document.createElement(options.tagName || 'div');
15
- this.vNode = this.createVM(component, options);
16
- }
17
- Mount.prototype.createVM = function (component, _a) {
18
- var _b = _a === void 0 ? {} : _a,
19
- props = _b.props,
20
- children = _b.children,
21
- patchFlag = _b.patchFlag,
22
- dynamicProps = _b.dynamicProps,
23
- isBlockNode = _b.isBlockNode,
24
- app = _b.app,
25
- context = _b.context,
26
- parent = _b.parent;
27
- var vNode;
28
- if (isVue2) {
29
- var VueConstructor = Vue2.extend(Object.assign({}, context || {}, component));
30
- vNode = new VueConstructor({
31
- parent: parent,
32
- propsData: props
33
- });
34
- vNode.id = 'mount-plugin-' + this.seed++;
35
- return vNode;
36
- } else {
37
- vNode = createVNode(component, props, children, patchFlag, dynamicProps, isBlockNode);
38
- if (app === null || app === void 0 ? void 0 : app._context) vNode.appContext = app._context;
39
- return vNode;
40
- }
41
- };
42
- Mount.prototype.mount = function () {
43
- !this.options.target && document.body.appendChild(this.target);
44
- if (isVue2) {
45
- this.vNode && this.vNode.$mount(this.target);
46
- } else {
47
- render(this.vNode, this.target);
48
- }
49
- };
50
- Mount.prototype.unmount = function () {
51
- if (isVue2) {
52
- this.vNode.$destroy();
53
- document.body.removeChild(this.vNode.$el);
54
- } else {
55
- render(null, this.target);
56
- document.body.removeChild(this.target);
57
- }
58
- this.vNode = null;
59
- this.target = null;
60
- };
61
- return Mount;
62
- }();
63
-
64
- export { Mount as default };
package/dist/index.cjs DELETED
@@ -1,65 +0,0 @@
1
- 'use strict';
2
-
3
- var vueDemi = require('vue-demi');
4
-
5
- var Mount = function () {
6
- function Mount(component, options) {
7
- if (options === void 0) {
8
- options = {};
9
- }
10
- this.vNode = null;
11
- this.options = {};
12
- this.seed = 1;
13
- if (typeof document === 'undefined') throw new Error('This plugin works in browser');
14
- this.options = options;
15
- this.target = (typeof options.target === 'string' ? document.querySelector(options.target) : options.target) || document.createElement(options.tagName || 'div');
16
- this.vNode = this.createVM(component, options);
17
- }
18
- Mount.prototype.createVM = function (component, _a) {
19
- var _b = _a === void 0 ? {} : _a,
20
- props = _b.props,
21
- children = _b.children,
22
- patchFlag = _b.patchFlag,
23
- dynamicProps = _b.dynamicProps,
24
- isBlockNode = _b.isBlockNode,
25
- app = _b.app,
26
- context = _b.context,
27
- parent = _b.parent;
28
- var vNode;
29
- if (vueDemi.isVue2) {
30
- var VueConstructor = vueDemi.Vue2.extend(Object.assign({}, context || {}, component));
31
- vNode = new VueConstructor({
32
- parent: parent,
33
- propsData: props
34
- });
35
- vNode.id = 'mount-plugin-' + this.seed++;
36
- return vNode;
37
- } else {
38
- vNode = vueDemi.createVNode(component, props, children, patchFlag, dynamicProps, isBlockNode);
39
- if (app === null || app === void 0 ? void 0 : app._context) vNode.appContext = app._context;
40
- return vNode;
41
- }
42
- };
43
- Mount.prototype.mount = function () {
44
- !this.options.target && document.body.appendChild(this.target);
45
- if (vueDemi.isVue2) {
46
- this.vNode && this.vNode.$mount(this.target);
47
- } else {
48
- vueDemi.render(this.vNode, this.target);
49
- }
50
- };
51
- Mount.prototype.unmount = function () {
52
- if (vueDemi.isVue2) {
53
- this.vNode.$destroy();
54
- document.body.removeChild(this.vNode.$el);
55
- } else {
56
- vueDemi.render(null, this.target);
57
- document.body.removeChild(this.target);
58
- }
59
- this.vNode = null;
60
- this.target = null;
61
- };
62
- return Mount;
63
- }();
64
-
65
- module.exports = Mount;
@@ -1,72 +0,0 @@
1
- /*!
2
- * vue-mount-plugin v2.1.0
3
- * A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
4
- * (c) 2021-2023 saqqdy <saqqdy@qq.com>
5
- * Released under the MIT License.
6
- */
7
- this.VueMount = (function (vueDemi) {
8
- 'use strict';
9
-
10
- var Mount = function () {
11
- function Mount(component, options) {
12
- if (options === void 0) {
13
- options = {};
14
- }
15
- this.vNode = null;
16
- this.options = {};
17
- this.seed = 1;
18
- if (typeof document === 'undefined') throw new Error('This plugin works in browser');
19
- this.options = options;
20
- this.target = (typeof options.target === 'string' ? document.querySelector(options.target) : options.target) || document.createElement(options.tagName || 'div');
21
- this.vNode = this.createVM(component, options);
22
- }
23
- Mount.prototype.createVM = function (component, _a) {
24
- var _b = _a === void 0 ? {} : _a,
25
- props = _b.props,
26
- children = _b.children,
27
- patchFlag = _b.patchFlag,
28
- dynamicProps = _b.dynamicProps,
29
- isBlockNode = _b.isBlockNode,
30
- app = _b.app,
31
- context = _b.context,
32
- parent = _b.parent;
33
- var vNode;
34
- if (vueDemi.isVue2) {
35
- var VueConstructor = vueDemi.Vue2.extend(Object.assign({}, context || {}, component));
36
- vNode = new VueConstructor({
37
- parent: parent,
38
- propsData: props
39
- });
40
- vNode.id = 'mount-plugin-' + this.seed++;
41
- return vNode;
42
- } else {
43
- vNode = vueDemi.createVNode(component, props, children, patchFlag, dynamicProps, isBlockNode);
44
- if (app === null || app === void 0 ? void 0 : app._context) vNode.appContext = app._context;
45
- return vNode;
46
- }
47
- };
48
- Mount.prototype.mount = function () {
49
- !this.options.target && document.body.appendChild(this.target);
50
- if (vueDemi.isVue2) {
51
- this.vNode && this.vNode.$mount(this.target);
52
- } else {
53
- vueDemi.render(this.vNode, this.target);
54
- }
55
- };
56
- Mount.prototype.unmount = function () {
57
- if (vueDemi.isVue2) {
58
- this.vNode.$destroy();
59
- document.body.removeChild(this.vNode.$el);
60
- } else {
61
- vueDemi.render(null, this.target);
62
- document.body.removeChild(this.target);
63
- }
64
- this.vNode = null;
65
- this.target = null;
66
- };
67
- return Mount;
68
- }();
69
-
70
- return Mount;
71
-
72
- })(VueDemi);
@@ -1,7 +0,0 @@
1
- /*!
2
- * vue-mount-plugin v2.1.0
3
- * A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
4
- * (c) 2021-2023 saqqdy <saqqdy@qq.com>
5
- * Released under the MIT License.
6
- */
7
- this.VueMount=function(t){"use strict";return function(){function e(t,e){if(void 0===e&&(e={}),this.vNode=null,this.options={},this.seed=1,"undefined"==typeof document)throw new Error("This plugin works in browser");this.options=e,this.target=("string"==typeof e.target?document.querySelector(e.target):e.target)||document.createElement(e.tagName||"div"),this.vNode=this.createVM(t,e)}return e.prototype.createVM=function(e,o){var n,i=void 0===o?{}:o,r=i.props,s=i.children,d=i.patchFlag,u=i.dynamicProps,a=i.isBlockNode,h=i.app,p=i.context,c=i.parent;return t.isVue2?((n=new(t.Vue2.extend(Object.assign({},p||{},e)))({parent:c,propsData:r})).id="mount-plugin-"+this.seed++,n):(n=t.createVNode(e,r,s,d,u,a),(null==h?void 0:h._context)&&(n.appContext=h._context),n)},e.prototype.mount=function(){!this.options.target&&document.body.appendChild(this.target),t.isVue2?this.vNode&&this.vNode.$mount(this.target):t.render(this.vNode,this.target)},e.prototype.unmount=function(){t.isVue2?(this.vNode.$destroy(),document.body.removeChild(this.vNode.$el)):(t.render(null,this.target),document.body.removeChild(this.target)),this.vNode=null,this.target=null},e}()}(VueDemi);