Skip to content

Commit

Permalink
fix: 移除浏览器环境自动注册为vue组件的代码
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaofan9 committed May 20, 2021
1 parent e9a3f1c commit 3886a73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "date-week-range",
"version": "2.0.0-beta.1",
"version": "2.0.0-beta.2",
"description": "date-week-range",
"main": "dist/date-week-range.min.js",
"module": "src/date-week-range.esm.js",
Expand Down
9 changes: 2 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import 'dayjs/locale/zh-cn'
import lang from 'element-plus/lib/locale/lang/zh-cn'
locale(lang)

function install(Vue, option = {}) {
Vue.component(DatePicker.name, DatePicker)
function install(app, option = {}) {
app.component(DatePicker.name, DatePicker)

locale(option.locale)
if (option.i18n) {
Expand All @@ -17,11 +17,6 @@ function install(Vue, option = {}) {
DatePicker.install = install
DatePicker.version = pkg.version

/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
install(window.Vue);
}

export const DateWeekRange = DatePicker;

export { locale }
Expand Down

0 comments on commit 3886a73

Please sign in to comment.