Skip to content

Commit

Permalink
chore(deps): upgrade gren & 支持 Vue.use (#73)
Browse files Browse the repository at this point in the history
  • Loading branch information
donaldshen authored and levy9527 committed Dec 17, 2019
1 parent 58514b8 commit 2708768
Show file tree
Hide file tree
Showing 4 changed files with 654 additions and 597 deletions.
32 changes: 0 additions & 32 deletions .grenrc.js

This file was deleted.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
"@babel/plugin-transform-runtime": "^7.4.3",
"@babel/preset-env": "^7.4.3",
"@femessage/el-form-renderer": "1.11.0",
"@femessage/github-release-notes": "^0.19.0",
"babel-loader": "^8.0.5",
"element-ui": "2.4.11",
"file-loader": "^3.0.1",
"github-release-notes": "^0.17.0",
"glob": "^7.1.3",
"husky": "1.3.1",
"jest": "^24.8.0",
Expand Down Expand Up @@ -95,5 +95,6 @@
"stylelint --fix",
"git add"
]
}
},
"gren": "@femessage/grenrc"
}
18 changes: 7 additions & 11 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
import Component from './el-select-area.vue'
import arealist from './arealist'

// install function executed by Vue.use()
export function install(Vue) {
if (install.installed) return
install.installed = true
Vue.component('ElSelectArea', Component)
}

// Create module definition for Vue.use()
const plugin = {
install
// `Vue.use` automatically prevents you from using
// the same plugin more than once,
// so calling it multiple times on the same plugin
// will install the plugin only once
Component.install = Vue => {
Vue.component(Component.name, Component)
}

// To auto-install when vue is found
Expand All @@ -22,7 +18,7 @@ if (typeof window !== 'undefined') {
GlobalVue = global.Vue
}
if (GlobalVue) {
GlobalVue.use(plugin)
GlobalVue.use(Component)
}

// To allow use as module (npm/webpack/etc.) export component
Expand Down
Loading

0 comments on commit 2708768

Please sign in to comment.