shijiplus-web-plugin 0.1.48 → 0.1.50

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shijiplus-web-plugin",
3
- "version": "0.1.48",
3
+ "version": "0.1.50",
4
4
  "files": [
5
5
  "src"
6
6
  ],
@@ -13,17 +13,23 @@ const install = (vue, opts = {}) => {
13
13
  return instance.show(config)
14
14
  }
15
15
  }
16
- const removeVComp = (vComp) => {
17
- if (vComp.$children && vComp.$children.length) {
18
- vComp.$children.forEach(item => {
19
- removeVComp(item)
20
- })
21
- }
22
- if (vComp.$el.parentNode) {
23
- vComp.$el.parentNode.removeChild(vComp.$el)
16
+ const removeVComp = (topComp) => {
17
+ const execFun = (vComp) => {
18
+ if (vComp.$children && vComp.$children.length) {
19
+ vComp.$children.forEach(item => {
20
+ execFun(item)
21
+ })
22
+ }
23
+ if (vComp.$el.parentNode) {
24
+ vComp.$el.parentNode.removeChild(vComp.$el)
25
+ }
24
26
  }
27
+ setTimeout(() => {
28
+ execFun(topComp)
29
+ }, 500)
25
30
  }
26
- vue.prototype.$getComponentInstance = (component, options) => {
31
+ vue.prototype.$removeVComp = removeVComp
32
+ const getComponentInstance = (component, options) => {
27
33
  const defaultConfig = {
28
34
  props: {}
29
35
  }
@@ -40,7 +46,8 @@ const install = (vue, opts = {}) => {
40
46
  document.body.appendChild(instance.$el)
41
47
  return instance
42
48
  }
43
- vue.prototype.$removeVComp = removeVComp
49
+
50
+ vue.prototype.$getComponentInstance = getComponentInstance
44
51
  }
45
52
 
46
53
  export default {