shijiplus-web-plugin 0.1.22 → 0.1.24
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
|
@@ -4,14 +4,16 @@ import datePlugin from './date'
|
|
|
4
4
|
import stringPlugin from './string'
|
|
5
5
|
import objectPlugin from './object'
|
|
6
6
|
import regularPlugin from './regular'
|
|
7
|
+
import viewPlugin from './view'
|
|
7
8
|
|
|
8
|
-
const install = (vue) => {
|
|
9
|
-
console.log('install extentionPlugin')
|
|
9
|
+
const install = (vue, opts) => {
|
|
10
|
+
console.log('install extentionPlugin', opts)
|
|
10
11
|
vue.use(arrayPlugin)
|
|
11
12
|
vue.use(datePlugin)
|
|
12
13
|
vue.use(stringPlugin)
|
|
13
14
|
vue.use(objectPlugin)
|
|
14
15
|
vue.use(regularPlugin)
|
|
16
|
+
vue.use(viewPlugin, opts)
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export default {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Vue from 'vue'
|
|
2
|
+
const install = (vue, opts = {}) => {
|
|
3
|
+
console.log('------view--install------', opts)
|
|
4
|
+
const removeVComp = (vComp) => {
|
|
5
|
+
if (vComp.$children && vComp.$children.length) {
|
|
6
|
+
vComp.$children.forEach(item => {
|
|
7
|
+
removeVComp(item)
|
|
8
|
+
})
|
|
9
|
+
}
|
|
10
|
+
if (vComp.$el.parentNode) {
|
|
11
|
+
vComp.$el.parentNode.removeChild(vComp.$el)
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
vue.prototype.$getComponentInstance = (component) => {
|
|
15
|
+
const ComponentClass = Vue.extend(component)
|
|
16
|
+
const instance = new ComponentClass({ store: opts.store })
|
|
17
|
+
instance.$mount()
|
|
18
|
+
document.body.appendChild(instance.$el)
|
|
19
|
+
return instance
|
|
20
|
+
}
|
|
21
|
+
vue.prototype.$removeVComp = removeVComp
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export default {
|
|
25
|
+
install
|
|
26
|
+
}
|
package/src/index.js
CHANGED