vue-mount-plugin 3.0.0 → 3.1.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.
- package/dist/index.esm-browser.js +114 -53
- package/dist/index.esm-browser.prod.js +2 -2
- package/dist/index.esm-bundler.js +113 -52
- package/dist/index.global.js +1 -1
- package/dist/index.global.prod.js +3 -3
- package/package.json +1 -1
|
@@ -1,65 +1,126 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-mount-plugin v3.
|
|
2
|
+
* vue-mount-plugin v3.1.0
|
|
3
3
|
* A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
|
|
4
4
|
* (c) 2021-2023 saqqdy <saqqdy@qq.com>
|
|
5
5
|
* Released under the MIT License.
|
|
6
6
|
*/
|
|
7
7
|
import { isVue2, Vue2, createVNode, render } from 'vue-demi';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
9
|
+
function _classCallCheck(instance, Constructor) {
|
|
10
|
+
if (!(instance instanceof Constructor)) {
|
|
11
|
+
throw new TypeError("Cannot call a class as a function");
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function _defineProperties(target, props) {
|
|
15
|
+
for (var i = 0; i < props.length; i++) {
|
|
16
|
+
var descriptor = props[i];
|
|
17
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
18
|
+
descriptor.configurable = true;
|
|
19
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
20
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
24
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
25
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
26
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
27
|
+
writable: false
|
|
28
|
+
});
|
|
29
|
+
return Constructor;
|
|
30
|
+
}
|
|
31
|
+
function _defineProperty(obj, key, value) {
|
|
32
|
+
key = _toPropertyKey(key);
|
|
33
|
+
if (key in obj) {
|
|
34
|
+
Object.defineProperty(obj, key, {
|
|
35
|
+
value: value,
|
|
36
|
+
enumerable: true,
|
|
37
|
+
configurable: true,
|
|
38
|
+
writable: true
|
|
39
|
+
});
|
|
40
|
+
} else {
|
|
41
|
+
obj[key] = value;
|
|
42
|
+
}
|
|
43
|
+
return obj;
|
|
44
|
+
}
|
|
45
|
+
function _toPrimitive(input, hint) {
|
|
46
|
+
if (typeof input !== "object" || input === null) return input;
|
|
47
|
+
var prim = input[Symbol.toPrimitive];
|
|
48
|
+
if (prim !== undefined) {
|
|
49
|
+
var res = prim.call(input, hint || "default");
|
|
50
|
+
if (typeof res !== "object") return res;
|
|
51
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
52
|
+
}
|
|
53
|
+
return (hint === "string" ? String : Number)(input);
|
|
54
|
+
}
|
|
55
|
+
function _toPropertyKey(arg) {
|
|
56
|
+
var key = _toPrimitive(arg, "string");
|
|
57
|
+
return typeof key === "symbol" ? key : String(key);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
var Mount = /*#__PURE__*/function () {
|
|
61
|
+
function Mount(component) {
|
|
62
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
63
|
+
_classCallCheck(this, Mount);
|
|
64
|
+
_defineProperty(this, "vNode", null);
|
|
65
|
+
_defineProperty(this, "options", {});
|
|
66
|
+
_defineProperty(this, "seed", 1);
|
|
67
|
+
if (typeof document === 'undefined') throw new Error('This plugin works in browser');
|
|
68
|
+
this.options = options;
|
|
69
|
+
this.target = (typeof options.target === 'string' ? document.querySelector(options.target) : options.target) || document.createElement(options.tagName || 'div');
|
|
70
|
+
this.vNode = this.createVM(component, options);
|
|
71
|
+
}
|
|
72
|
+
_createClass(Mount, [{
|
|
73
|
+
key: "createVM",
|
|
74
|
+
value: function createVM(component) {
|
|
75
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
76
|
+
props = _ref.props,
|
|
77
|
+
children = _ref.children,
|
|
78
|
+
patchFlag = _ref.patchFlag,
|
|
79
|
+
dynamicProps = _ref.dynamicProps,
|
|
80
|
+
isBlockNode = _ref.isBlockNode,
|
|
81
|
+
app = _ref.app,
|
|
82
|
+
context = _ref.context,
|
|
83
|
+
parent = _ref.parent;
|
|
84
|
+
var vNode;
|
|
85
|
+
if (isVue2) {
|
|
86
|
+
var VueConstructor = Vue2.extend(Object.assign({}, context || {}, component));
|
|
87
|
+
vNode = new VueConstructor({
|
|
88
|
+
parent: parent,
|
|
89
|
+
propsData: props
|
|
90
|
+
});
|
|
91
|
+
vNode.id = 'mount-plugin-' + this.seed++;
|
|
92
|
+
return vNode;
|
|
93
|
+
} else {
|
|
94
|
+
vNode = createVNode(component, props, children, patchFlag, dynamicProps, isBlockNode);
|
|
95
|
+
if (app !== null && app !== void 0 && app._context) vNode.appContext = app._context;
|
|
96
|
+
return vNode;
|
|
97
|
+
}
|
|
41
98
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
99
|
+
}, {
|
|
100
|
+
key: "mount",
|
|
101
|
+
value: function mount() {
|
|
102
|
+
!this.options.target && document.body.appendChild(this.target);
|
|
103
|
+
if (isVue2) {
|
|
104
|
+
this.vNode && this.vNode.$mount(this.target);
|
|
105
|
+
} else {
|
|
106
|
+
render(this.vNode, this.target);
|
|
107
|
+
}
|
|
50
108
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
109
|
+
}, {
|
|
110
|
+
key: "unmount",
|
|
111
|
+
value: function unmount() {
|
|
112
|
+
if (isVue2) {
|
|
113
|
+
this.vNode.$destroy();
|
|
114
|
+
document.body.removeChild(this.vNode.$el);
|
|
115
|
+
} else {
|
|
116
|
+
render(null, this.target);
|
|
117
|
+
document.body.removeChild(this.target);
|
|
118
|
+
}
|
|
119
|
+
this.vNode = null;
|
|
120
|
+
this.target = null;
|
|
62
121
|
}
|
|
63
|
-
}
|
|
122
|
+
}]);
|
|
123
|
+
return Mount;
|
|
124
|
+
}();
|
|
64
125
|
|
|
65
126
|
export { Mount as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* vue-mount-plugin v3.
|
|
2
|
+
* vue-mount-plugin v3.1.0
|
|
3
3
|
* A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
|
|
4
4
|
* (c) 2021-2023 saqqdy <saqqdy@qq.com>
|
|
5
5
|
* Released under the MIT License.
|
|
6
6
|
*/
|
|
7
|
-
import{isVue2 as
|
|
7
|
+
import{isVue2 as e,Vue2 as t,createVNode as r,render as n}from"vue-demi";function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function i(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var u=function(){function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),i(this,"vNode",null),i(this,"options",{}),i(this,"seed",1),"undefined"==typeof document)throw new Error("This plugin works in browser");this.options=t,this.target=("string"==typeof t.target?document.querySelector(t.target):t.target)||document.createElement(t.tagName||"div"),this.vNode=this.createVM(e,t)}var u,s;return u=a,s=[{key:"createVM",value:function(n){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=i.props,u=i.children,s=i.patchFlag,l=i.dynamicProps,d=i.isBlockNode,c=i.app,p=i.context,h=i.parent;return e?((o=new(t.extend(Object.assign({},p||{},n)))({parent:h,propsData:a})).id="mount-plugin-"+this.seed++,o):(o=r(n,a,u,s,l,d),null!=c&&c._context&&(o.appContext=c._context),o)}},{key:"mount",value:function(){!this.options.target&&document.body.appendChild(this.target),e?this.vNode&&this.vNode.$mount(this.target):n(this.vNode,this.target)}},{key:"unmount",value:function(){e?(this.vNode.$destroy(),document.body.removeChild(this.vNode.$el)):(n(null,this.target),document.body.removeChild(this.target)),this.vNode=null,this.target=null}}],s&&o(u.prototype,s),Object.defineProperty(u,"prototype",{writable:!1}),a}();export{u as default};
|
|
@@ -1,59 +1,120 @@
|
|
|
1
1
|
import { isVue2, Vue2, createVNode, render } from 'vue-demi';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
3
|
+
function _classCallCheck(instance, Constructor) {
|
|
4
|
+
if (!(instance instanceof Constructor)) {
|
|
5
|
+
throw new TypeError("Cannot call a class as a function");
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function _defineProperties(target, props) {
|
|
9
|
+
for (var i = 0; i < props.length; i++) {
|
|
10
|
+
var descriptor = props[i];
|
|
11
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
12
|
+
descriptor.configurable = true;
|
|
13
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
14
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
18
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
19
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
20
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
21
|
+
writable: false
|
|
22
|
+
});
|
|
23
|
+
return Constructor;
|
|
24
|
+
}
|
|
25
|
+
function _defineProperty(obj, key, value) {
|
|
26
|
+
key = _toPropertyKey(key);
|
|
27
|
+
if (key in obj) {
|
|
28
|
+
Object.defineProperty(obj, key, {
|
|
29
|
+
value: value,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
obj[key] = value;
|
|
36
|
+
}
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
function _toPrimitive(input, hint) {
|
|
40
|
+
if (typeof input !== "object" || input === null) return input;
|
|
41
|
+
var prim = input[Symbol.toPrimitive];
|
|
42
|
+
if (prim !== undefined) {
|
|
43
|
+
var res = prim.call(input, hint || "default");
|
|
44
|
+
if (typeof res !== "object") return res;
|
|
45
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
46
|
+
}
|
|
47
|
+
return (hint === "string" ? String : Number)(input);
|
|
48
|
+
}
|
|
49
|
+
function _toPropertyKey(arg) {
|
|
50
|
+
var key = _toPrimitive(arg, "string");
|
|
51
|
+
return typeof key === "symbol" ? key : String(key);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
var Mount = /*#__PURE__*/function () {
|
|
55
|
+
function Mount(component) {
|
|
56
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
57
|
+
_classCallCheck(this, Mount);
|
|
58
|
+
_defineProperty(this, "vNode", null);
|
|
59
|
+
_defineProperty(this, "options", {});
|
|
60
|
+
_defineProperty(this, "seed", 1);
|
|
61
|
+
if (typeof document === 'undefined') throw new Error('This plugin works in browser');
|
|
62
|
+
this.options = options;
|
|
63
|
+
this.target = (typeof options.target === 'string' ? document.querySelector(options.target) : options.target) || document.createElement(options.tagName || 'div');
|
|
64
|
+
this.vNode = this.createVM(component, options);
|
|
65
|
+
}
|
|
66
|
+
_createClass(Mount, [{
|
|
67
|
+
key: "createVM",
|
|
68
|
+
value: function createVM(component) {
|
|
69
|
+
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
70
|
+
props = _ref.props,
|
|
71
|
+
children = _ref.children,
|
|
72
|
+
patchFlag = _ref.patchFlag,
|
|
73
|
+
dynamicProps = _ref.dynamicProps,
|
|
74
|
+
isBlockNode = _ref.isBlockNode,
|
|
75
|
+
app = _ref.app,
|
|
76
|
+
context = _ref.context,
|
|
77
|
+
parent = _ref.parent;
|
|
78
|
+
var vNode;
|
|
79
|
+
if (isVue2) {
|
|
80
|
+
var VueConstructor = Vue2.extend(Object.assign({}, context || {}, component));
|
|
81
|
+
vNode = new VueConstructor({
|
|
82
|
+
parent: parent,
|
|
83
|
+
propsData: props
|
|
84
|
+
});
|
|
85
|
+
vNode.id = 'mount-plugin-' + this.seed++;
|
|
86
|
+
return vNode;
|
|
87
|
+
} else {
|
|
88
|
+
vNode = createVNode(component, props, children, patchFlag, dynamicProps, isBlockNode);
|
|
89
|
+
if (app !== null && app !== void 0 && app._context) vNode.appContext = app._context;
|
|
90
|
+
return vNode;
|
|
91
|
+
}
|
|
35
92
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
93
|
+
}, {
|
|
94
|
+
key: "mount",
|
|
95
|
+
value: function mount() {
|
|
96
|
+
!this.options.target && document.body.appendChild(this.target);
|
|
97
|
+
if (isVue2) {
|
|
98
|
+
this.vNode && this.vNode.$mount(this.target);
|
|
99
|
+
} else {
|
|
100
|
+
render(this.vNode, this.target);
|
|
101
|
+
}
|
|
44
102
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
103
|
+
}, {
|
|
104
|
+
key: "unmount",
|
|
105
|
+
value: function unmount() {
|
|
106
|
+
if (isVue2) {
|
|
107
|
+
this.vNode.$destroy();
|
|
108
|
+
document.body.removeChild(this.vNode.$el);
|
|
109
|
+
} else {
|
|
110
|
+
render(null, this.target);
|
|
111
|
+
document.body.removeChild(this.target);
|
|
112
|
+
}
|
|
113
|
+
this.vNode = null;
|
|
114
|
+
this.target = null;
|
|
56
115
|
}
|
|
57
|
-
}
|
|
116
|
+
}]);
|
|
117
|
+
return Mount;
|
|
118
|
+
}();
|
|
58
119
|
|
|
59
120
|
export { Mount as default };
|
package/dist/index.global.js
CHANGED
|
@@ -115,7 +115,7 @@ var VueDemi = (function (VueDemi, Vue, VueCompositionAPI) {
|
|
|
115
115
|
);
|
|
116
116
|
;
|
|
117
117
|
/*!
|
|
118
|
-
* vue-mount-plugin v3.
|
|
118
|
+
* vue-mount-plugin v3.1.0
|
|
119
119
|
* A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
|
|
120
120
|
* (c) 2021-2023 saqqdy <saqqdy@qq.com>
|
|
121
121
|
* Released under the MIT License.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var VueDemi=function(e,t,
|
|
1
|
+
var VueDemi=function(e,t,n){if(e.install)return e;if(!t)return console.error("[vue-demi] no Vue instance found, please be sure to import `vue` before `vue-demi`."),e;if("2.7."===t.version.slice(0,4)){for(var i in t)e[i]=t[i];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=t,e.Vue2=t,e.version=t.version,e.warn=t.util.warn,e.hasInjectionContext=()=>!!e.getCurrentInstance(),e.createApp=function(e,n){var i,o={},r={config:t.config,use:t.use.bind(t),mixin:t.mixin.bind(t),component:t.component.bind(t),provide:function(e,t){return o[e]=t,this},directive:function(e,n){return n?(t.directive(e,n),r):t.directive(e)},mount:function(r,u){return i||((i=new t(Object.assign({propsData:n},e,{provide:Object.assign(o,e.provide)}))).$mount(r,u),i)},unmount:function(){i&&(i.$destroy(),i=void 0)}};return r}}else if("2."===t.version.slice(0,2))if(n){for(var i in n)e[i]=n[i];e.isVue2=!0,e.isVue3=!1,e.install=function(){},e.Vue=t,e.Vue2=t,e.version=t.version,e.hasInjectionContext=()=>!!e.getCurrentInstance()}else console.error("[vue-demi] no VueCompositionAPI instance found, please be sure to import `@vue/composition-api` before `vue-demi`.");else if("3."===t.version.slice(0,2)){for(var i in t)e[i]=t[i];e.isVue2=!1,e.isVue3=!0,e.install=function(){},e.Vue=t,e.Vue2=void 0,e.version=t.version,e.set=function(e,t,n){return Array.isArray(e)?(e.length=Math.max(e.length,t),e.splice(t,1,n),n):(e[t]=n,n)},e.del=function(e,t){Array.isArray(e)?e.splice(t,1):delete e[t]}}else console.error("[vue-demi] Vue version "+t.version+" is unsupported.");return e}(this.VueDemi=this.VueDemi||(void 0!==VueDemi?VueDemi:{}),this.Vue||("undefined"!=typeof Vue?Vue:void 0),this.VueCompositionAPI||("undefined"!=typeof VueCompositionAPI?VueCompositionAPI:void 0));
|
|
2
2
|
/*!
|
|
3
|
-
* vue-mount-plugin v3.
|
|
3
|
+
* vue-mount-plugin v3.1.0
|
|
4
4
|
* A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0
|
|
5
5
|
* (c) 2021-2023 saqqdy <saqqdy@qq.com>
|
|
6
6
|
* Released under the MIT License.
|
|
7
7
|
*/
|
|
8
|
-
this.VueMount=function(e){"use strict";
|
|
8
|
+
this.VueMount=function(e){"use strict";function t(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,i(o.key),o)}}function n(e,t,n){return(t=i(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var o=function(){function i(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),n(this,"vNode",null),n(this,"options",{}),n(this,"seed",1),"undefined"==typeof document)throw new Error("This plugin works in browser");this.options=t,this.target=("string"==typeof t.target?document.querySelector(t.target):t.target)||document.createElement(t.tagName||"div"),this.vNode=this.createVM(e,t)}var o,r;return o=i,r=[{key:"createVM",value:function(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.props,r=i.children,u=i.patchFlag,s=i.dynamicProps,a=i.isBlockNode,c=i.app,l=i.context,d=i.parent;return e.isVue2?((n=new(e.Vue2.extend(Object.assign({},l||{},t)))({parent:d,propsData:o})).id="mount-plugin-"+this.seed++,n):(n=e.createVNode(t,o,r,u,s,a),null!=c&&c._context&&(n.appContext=c._context),n)}},{key:"mount",value:function(){!this.options.target&&document.body.appendChild(this.target),e.isVue2?this.vNode&&this.vNode.$mount(this.target):e.render(this.vNode,this.target)}},{key:"unmount",value:function(){e.isVue2?(this.vNode.$destroy(),document.body.removeChild(this.vNode.$el)):(e.render(null,this.target),document.body.removeChild(this.target)),this.vNode=null,this.target=null}}],r&&t(o.prototype,r),Object.defineProperty(o,"prototype",{writable:!1}),i}();return o}(VueDemi);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-mount-plugin",
|
|
3
3
|
"description": "A simple and easy to use vue instance extension plugin that supports vue2.0 and vue3.0",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.1.0",
|
|
5
5
|
"packageManager": "pnpm@8.5.1",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
7
7
|
"module": "dist/index.esm-bundler.js",
|