Skip to content

Commit 2708768

Browse files
donaldshenlevy9527
authored andcommitted
chore(deps): upgrade gren & 支持 Vue.use (#73)
1 parent 58514b8 commit 2708768

File tree

4 files changed

+654
-597
lines changed

4 files changed

+654
-597
lines changed

.grenrc.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@
4444
"@babel/plugin-transform-runtime": "^7.4.3",
4545
"@babel/preset-env": "^7.4.3",
4646
"@femessage/el-form-renderer": "1.11.0",
47+
"@femessage/github-release-notes": "^0.19.0",
4748
"babel-loader": "^8.0.5",
4849
"element-ui": "2.4.11",
4950
"file-loader": "^3.0.1",
50-
"github-release-notes": "^0.17.0",
5151
"glob": "^7.1.3",
5252
"husky": "1.3.1",
5353
"jest": "^24.8.0",
@@ -95,5 +95,6 @@
9595
"stylelint --fix",
9696
"git add"
9797
]
98-
}
98+
},
99+
"gren": "@femessage/grenrc"
99100
}

src/index.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,12 @@
22
import Component from './el-select-area.vue'
33
import arealist from './arealist'
44

5-
// install function executed by Vue.use()
6-
export function install(Vue) {
7-
if (install.installed) return
8-
install.installed = true
9-
Vue.component('ElSelectArea', Component)
10-
}
11-
12-
// Create module definition for Vue.use()
13-
const plugin = {
14-
install
5+
// `Vue.use` automatically prevents you from using
6+
// the same plugin more than once,
7+
// so calling it multiple times on the same plugin
8+
// will install the plugin only once
9+
Component.install = Vue => {
10+
Vue.component(Component.name, Component)
1511
}
1612

1713
// To auto-install when vue is found
@@ -22,7 +18,7 @@ if (typeof window !== 'undefined') {
2218
GlobalVue = global.Vue
2319
}
2420
if (GlobalVue) {
25-
GlobalVue.use(plugin)
21+
GlobalVue.use(Component)
2622
}
2723

2824
// To allow use as module (npm/webpack/etc.) export component

0 commit comments

Comments
 (0)