From b0893113b3b6781de46b13b82a9a24e74f1be04f Mon Sep 17 00:00:00 2001 From: jingsam Date: Sun, 25 Dec 2016 22:49:42 +0800 Subject: [PATCH] :art: add eslint --- .eslintrc.json | 18 ++++++++++++++++++ .travis.yml | 9 +++------ build/build-style.js | 16 ++++++++-------- package.json | 7 ++++--- src/components/affix/affix.vue | 10 +++++----- src/components/alert/alert.vue | 8 ++++---- src/components/back-top/back-top.vue | 8 ++++---- src/components/badge/badge.vue | 8 ++++---- src/components/base/notification/index.js | 2 +- src/components/base/notification/notice.vue | 10 +++++----- src/components/base/notification/notification.vue | 10 +++++----- src/components/base/popper.js | 4 ++-- src/components/breadcrumb/breadcrumb-item.vue | 4 ++-- src/components/breadcrumb/breadcrumb.vue | 4 ++-- src/components/button/button-group.vue | 6 +++--- src/components/button/button.vue | 6 +++--- src/components/card/card.vue | 8 ++++---- src/components/cascader/cascader.vue | 12 ++++++------ src/components/cascader/casitem.vue | 6 +++--- src/components/cascader/caspanel.vue | 11 +++++------ src/components/checkbox/checkbox-group.vue | 13 ++++--------- src/components/checkbox/checkbox.vue | 10 +++++----- src/components/circle/circle.vue | 6 +++--- src/components/collapse/collapse.vue | 6 +++--- src/components/collapse/panel.vue | 8 ++++---- src/components/date-picker/base/confirm.vue | 6 +++--- src/components/date-picker/base/date-table.vue | 12 ++++++------ src/components/date-picker/base/month-table.vue | 8 ++++---- src/components/date-picker/base/year-table.vue | 8 ++++---- src/components/date-picker/panel/date-range.vue | 8 ++++---- src/components/date-picker/panel/date.vue | 9 ++++----- src/components/date-picker/panel/mixin.js | 4 ++-- src/components/date-picker/picker.vue | 6 +++--- src/components/date-picker/picker/date-picker.js | 2 +- src/components/dropdown/dropdown-item.vue | 6 +++--- src/components/dropdown/dropdown-menu.vue | 4 ++-- src/components/dropdown/dropdown.vue | 6 +++--- src/components/icon/icon.vue | 10 +++++----- src/components/input-number/input-number.vue | 18 +++++++++--------- src/components/input/input.vue | 12 ++++++------ src/components/layout/col.vue | 10 ++++------ src/components/layout/row.vue | 8 ++++---- src/components/loading-bar/index.js | 4 ++-- src/components/loading-bar/loading-bar.js | 2 +- src/components/loading-bar/loading-bar.vue | 8 ++++---- src/components/menu/menu-group.vue | 6 +++--- src/components/menu/menu-item.vue | 8 ++++---- src/components/menu/menu.vue | 18 +++++++++--------- src/components/menu/submenu.vue | 8 ++++---- src/components/message/index.js | 6 +++--- src/components/modal/confirm.js | 6 +++--- src/components/modal/modal.vue | 10 +++++----- src/components/notice/index.js | 2 +- src/components/page/options.vue | 10 +++++----- src/components/page/page.vue | 22 +++++++++++----------- src/components/poptip/poptip.vue | 8 ++++---- src/components/progress/progress.vue | 10 +++++----- src/components/radio/radio-group.vue | 8 ++++---- src/components/radio/radio.vue | 10 +++++----- src/components/select/dropdown.vue | 6 +++--- src/components/select/option-group.vue | 4 ++-- src/components/select/option.vue | 10 +++++----- src/components/select/select.vue | 12 ++++++------ src/components/slider/slider.vue | 12 ++++++------ src/components/spin/spin.vue | 8 ++++---- src/components/steps/step.vue | 12 ++++++------ src/components/steps/steps.vue | 6 +++--- src/components/switch/switch.vue | 6 +++--- src/components/table/cell.vue | 8 ++++---- src/components/table/export-csv.js | 18 +++++++++--------- src/components/table/mixin.js | 8 ++++---- src/components/table/table-body.vue | 6 +++--- src/components/table/table-head.vue | 11 +++++------ src/components/table/table.vue | 24 ++++++++++++------------ src/components/tabs/pane.vue | 6 +++--- src/components/tabs/tabs.vue | 20 ++++++++++---------- src/components/tag/tag.vue | 8 ++++---- src/components/timeline/timeline-item.vue | 10 +++++----- src/components/timeline/timeline.vue | 6 +++--- src/components/tooltip/tooltip.vue | 4 ++-- src/components/transfer/list.vue | 10 +++++----- src/components/transfer/operation.vue | 2 +- src/components/transfer/search.vue | 4 ++-- src/components/transfer/transfer.vue | 20 ++++++++++---------- src/directives/clickoutside.js | 2 +- src/index.js | 6 +++--- src/utils/assist.js | 2 +- src/utils/calcTextareaHeight.js | 2 +- 88 files changed, 376 insertions(+), 370 deletions(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..8b34c71 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "root": true, + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "env": { + "browser": true + }, + "extends": "eslint:recommended", + "plugins": [ "html" ], + "rules": { + "indent": ["error", 4, { "SwitchCase": 1 }], + "quotes": ["error", "single"], + "semi": ["error", "always"], + "no-console": ["off"] + } +} diff --git a/.travis.yml b/.travis.yml index f791c36..dffbd48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,5 @@ -sudo: false - language: node_js - node_js: - - "5" - -script: make dist \ No newline at end of file + - "4" +script: + - npm run test diff --git a/build/build-style.js b/build/build-style.js index 0bb8e97..74eb4af 100644 --- a/build/build-style.js +++ b/build/build-style.js @@ -6,20 +6,20 @@ var autoprefixer = require('gulp-autoprefixer'); // 编译less gulp.task('css', function () { - gulp.src('../src/styles/index.less') - .pipe(less()) - .pipe(autoprefixer({ + gulp.src('../src/styles/index.less') + .pipe(less()) + .pipe(autoprefixer({ browsers: ['last 2 versions', 'ie > 8'] - })) - .pipe(cleanCSS()) - .pipe(rename('iview.css')) - .pipe(gulp.dest('../dist/styles')) + })) + .pipe(cleanCSS()) + .pipe(rename('iview.css')) + .pipe(gulp.dest('../dist/styles')); }); // 拷贝字体文件 gulp.task('fonts', function () { gulp.src('../src/styles/common/iconfont/fonts/*.*') - .pipe(gulp.dest('../dist/styles/fonts')) + .pipe(gulp.dest('../dist/styles/fonts')); }); gulp.task('default', ['css', 'fonts']); diff --git a/package.json b/package.json index 2f800d5..b8097d9 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,8 @@ "dist:dev": "webpack --config build/webpack.dist.dev.config.js", "dist:prod": "webpack --config build/webpack.dist.prod.config.js", "dist": "npm run dist:style && npm run dist:dev && npm run dist:prod", + "lint": "eslint --fix --ext .js,.vue src", + "test": "npm run dist && npm run lint", "prepublish": "npm run dist" }, "repository": { @@ -51,9 +53,8 @@ "babel-preset-es2015": "^6.9.0", "babel-runtime": "^6.11.6", "css-loader": "^0.23.1", - "eslint": "^2.5.3", - "eslint-friendly-formatter": "^2.0.6", - "eslint-loader": "^1.3.0", + "eslint": "^3.12.2", + "eslint-plugin-html": "^1.7.0", "extract-text-webpack-plugin": "^1.0.1", "file-loader": "^0.8.5", "gulp": "^3.9.1", diff --git a/src/components/affix/affix.vue b/src/components/affix/affix.vue index 5ea37df..846a4ac 100644 --- a/src/components/affix/affix.vue +++ b/src/components/affix/affix.vue @@ -35,7 +35,7 @@ return { top: rect.top + scrollTop - clientTop, left: rect.left + scrollLeft - clientLeft - } + }; } export default { @@ -52,7 +52,7 @@ return { affix: false, styles: {} - } + }; }, computed: { offsetType () { @@ -68,7 +68,7 @@ { [`${prefixCls}`]: this.affix } - ] + ]; } }, ready () { @@ -117,10 +117,10 @@ } else if ((elOffset.top + this.offsetBottom + elHeight) < (scrollTop + windowHeight) && this.offsetType == 'bottom' && affix) { this.affix = false; this.styles = null; - + this.$emit('on-change', false); } } } - } + }; diff --git a/src/components/alert/alert.vue b/src/components/alert/alert.vue index b3136a7..983b5fc 100644 --- a/src/components/alert/alert.vue +++ b/src/components/alert/alert.vue @@ -42,7 +42,7 @@ return { closed: false, desc: false - } + }; }, computed: { wrapClasses () { @@ -53,7 +53,7 @@ [`${prefixCls}-with-icon`]: this.showIcon, [`${prefixCls}-with-desc`]: this.desc } - ] + ]; }, messageClasses () { return `${prefixCls}-message`; @@ -97,5 +97,5 @@ compiled () { this.desc = this.$els.desc.innerHTML != ''; } - } - \ No newline at end of file + }; + diff --git a/src/components/back-top/back-top.vue b/src/components/back-top/back-top.vue index 98ef6de..a4d4f7f 100644 --- a/src/components/back-top/back-top.vue +++ b/src/components/back-top/back-top.vue @@ -28,7 +28,7 @@ data () { return { backTop: false - } + }; }, ready () { window.addEventListener('scroll', this.handleScroll, false); @@ -45,13 +45,13 @@ { [`${prefixCls}-show`]: this.backTop } - ] + ]; }, styles () { return { bottom: `${this.bottom}px`, right: `${this.right}px` - } + }; }, innerClasses () { return `${prefixCls}-inner`; @@ -66,5 +66,5 @@ this.$emit('on-click'); } } - } + }; diff --git a/src/components/badge/badge.vue b/src/components/badge/badge.vue index 67e78d6..d80120e 100644 --- a/src/components/badge/badge.vue +++ b/src/components/badge/badge.vue @@ -38,7 +38,7 @@ [`${this.class}`]: !!this.class, [`${prefixCls}-count-alone`]: this.alone } - ] + ]; }, finalCount () { return parseInt(this.count) >= parseInt(this.overflowCount) ? `${this.overflowCount}+` : this.count; @@ -65,7 +65,7 @@ data () { return { alone: false - } + }; }, compiled () { const child_length = this.$els.badge.children.length; @@ -73,5 +73,5 @@ this.alone = true; } } - } - \ No newline at end of file + }; + diff --git a/src/components/base/notification/index.js b/src/components/base/notification/index.js index 2c7170e..2bd5c4b 100644 --- a/src/components/base/notification/index.js +++ b/src/components/base/notification/index.js @@ -31,7 +31,7 @@ Notification.newInstance = properties => { destroy () { document.body.removeChild(div); } - } + }; }; export default Notification; diff --git a/src/components/base/notification/notice.vue b/src/components/base/notification/notice.vue index 6fe88be..c360afc 100644 --- a/src/components/base/notification/notice.vue +++ b/src/components/base/notification/notice.vue @@ -26,7 +26,7 @@ default: function() { return { right: '50%' - } + }; } }, closable: { @@ -50,7 +50,7 @@ data () { return { withDesc: false - } + }; }, computed: { baseClass () { @@ -64,7 +64,7 @@ [`${this.baseClass}-closable`]: this.closable, [`${this.baseClass}-with-desc`]: this.withDesc } - ] + ]; }, contentClasses () { return `${this.baseClass}-content`; @@ -89,7 +89,7 @@ if (this.duration !== 0) { this.closeTimer = setTimeout(() => { this.close(); - }, this.duration * 1000) + }, this.duration * 1000); } // check if with desc in Notice component @@ -100,5 +100,5 @@ beforeDestroy () { this.clearCloseTimer(); } - } + }; diff --git a/src/components/base/notification/notification.vue b/src/components/base/notification/notification.vue index 7cdb74c..bb3bcf6 100644 --- a/src/components/base/notification/notification.vue +++ b/src/components/base/notification/notification.vue @@ -36,7 +36,7 @@ return { top: '65px', left: '50%' - } + }; } }, content: { @@ -49,7 +49,7 @@ data () { return { notices: [] - } + }; }, computed: { classes () { @@ -58,7 +58,7 @@ { [`${this.className}`]: !!this.className } - ] + ]; } }, methods: { @@ -88,5 +88,5 @@ } } } - } - \ No newline at end of file + }; + diff --git a/src/components/base/popper.js b/src/components/base/popper.js index 616c7c8..5dd8aa2 100644 --- a/src/components/base/popper.js +++ b/src/components/base/popper.js @@ -26,7 +26,7 @@ export default { return { gpuAcceleration: false, boundariesElement: 'body' - } + }; } }, visible: { @@ -103,4 +103,4 @@ export default { this.popperJS.destroy(); } } -}; \ No newline at end of file +}; diff --git a/src/components/breadcrumb/breadcrumb-item.vue b/src/components/breadcrumb/breadcrumb-item.vue index 3a7f9d8..427d265 100644 --- a/src/components/breadcrumb/breadcrumb-item.vue +++ b/src/components/breadcrumb/breadcrumb-item.vue @@ -32,5 +32,5 @@ return `${prefixCls}-separator`; } } - } - \ No newline at end of file + }; + diff --git a/src/components/breadcrumb/breadcrumb.vue b/src/components/breadcrumb/breadcrumb.vue index 6643ae0..81b89a6 100644 --- a/src/components/breadcrumb/breadcrumb.vue +++ b/src/components/breadcrumb/breadcrumb.vue @@ -33,5 +33,5 @@ this.updateChildren(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/button/button-group.vue b/src/components/button/button-group.vue index 4d51996..de2f624 100644 --- a/src/components/button/button-group.vue +++ b/src/components/button/button-group.vue @@ -34,8 +34,8 @@ [`${prefixCls}-${this.shape}`]: !!this.shape, [`${prefixCls}-vertical`]: this.vertical } - ] + ]; } } - } - \ No newline at end of file + }; + diff --git a/src/components/button/button.vue b/src/components/button/button.vue index b64d8e2..72cf25d 100644 --- a/src/components/button/button.vue +++ b/src/components/button/button.vue @@ -46,7 +46,7 @@ data () { return { showSlot: true - } + }; }, computed: { classes () { @@ -60,11 +60,11 @@ [`${prefixCls}-loading`]: this.loading != null && this.loading, [`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || this.loading) } - ] + ]; } }, compiled () { this.showSlot = this.$els.slot.innerHTML.replace(/\n/g, '').replace(//gmi, '') !== ''; } - } + }; diff --git a/src/components/card/card.vue b/src/components/card/card.vue index 6f859cd..d336ca9 100644 --- a/src/components/card/card.vue +++ b/src/components/card/card.vue @@ -27,7 +27,7 @@ return { showHead: true, showExtra: true - } + }; }, computed: { classes () { @@ -38,7 +38,7 @@ [`${prefixCls}-dis-hover`]: this.disHover || this.shadow, [`${prefixCls}-shadow`]: this.shadow } - ] + ]; }, headClasses () { return `${prefixCls}-head`; @@ -54,5 +54,5 @@ this.showHead = this.$els.head.innerHTML != ''; this.showExtra = this.$els.extra.innerHTML != ''; } - } - \ No newline at end of file + }; + diff --git a/src/components/cascader/cascader.vue b/src/components/cascader/cascader.vue index ba3090c..ed94961 100644 --- a/src/components/cascader/cascader.vue +++ b/src/components/cascader/cascader.vue @@ -39,13 +39,13 @@ data: { type: Array, default () { - return [] + return []; } }, value: { type: Array, default () { - return [] + return []; } }, disabled: { @@ -88,7 +88,7 @@ visible: false, selected: [], tmpSelected: [] - } + }; }, computed: { classes () { @@ -99,7 +99,7 @@ [`${prefixCls}-visible`]: this.visible, [`${prefixCls}-disabled`]: this.disabled } - ] + ]; }, showCloseIcon () { return this.value && this.value.length && this.clearable; @@ -182,5 +182,5 @@ this.updateSelected(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/cascader/casitem.vue b/src/components/cascader/casitem.vue index b9eb140..a0171b2 100644 --- a/src/components/cascader/casitem.vue +++ b/src/components/cascader/casitem.vue @@ -16,8 +16,8 @@ [`${this.prefixCls}-menu-item-active`]: this.tmpItem.value === this.data.value, [`${this.prefixCls}-menu-item-disabled`]: this.data.disabled } - ] + ]; } } - } - \ No newline at end of file + }; + diff --git a/src/components/cascader/caspanel.vue b/src/components/cascader/caspanel.vue index 4bc8655..bae638c 100644 --- a/src/components/cascader/caspanel.vue +++ b/src/components/cascader/caspanel.vue @@ -11,7 +11,6 @@ \ No newline at end of file + }; + diff --git a/src/components/checkbox/checkbox-group.vue b/src/components/checkbox/checkbox-group.vue index 40085f6..4fe2649 100644 --- a/src/components/checkbox/checkbox-group.vue +++ b/src/components/checkbox/checkbox-group.vue @@ -12,7 +12,7 @@ model: { type: Array, default () { - return [] + return []; } } }, @@ -43,14 +43,9 @@ } }, watch: { - model (val, oldVal) { -// if (val == oldVal) { -// this.updateModel(); -// } else { -// this.updateModel(true); -// } + model () { this.updateModel(true); } } - } - \ No newline at end of file + }; + diff --git a/src/components/checkbox/checkbox.vue b/src/components/checkbox/checkbox.vue index 2467283..3f126fc 100644 --- a/src/components/checkbox/checkbox.vue +++ b/src/components/checkbox/checkbox.vue @@ -44,7 +44,7 @@ selected: false, group: false, showSlot: true - } + }; }, computed: { wrapClasses () { @@ -55,7 +55,7 @@ [`${prefixCls}-wrapper-checked`]: this.selected, [`${prefixCls}-wrapper-disabled`]: this.disabled } - ] + ]; }, checkboxClasses () { return [ @@ -64,7 +64,7 @@ [`${prefixCls}-checked`]: this.selected, [`${prefixCls}-disabled`]: this.disabled } - ] + ]; }, innerClasses () { return `${prefixCls}-inner`; @@ -105,5 +105,5 @@ this.updateModel(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/circle/circle.vue b/src/components/circle/circle.vue index 64ba422..a1cc95e 100644 --- a/src/components/circle/circle.vue +++ b/src/components/circle/circle.vue @@ -70,7 +70,7 @@ 'stroke-dasharray': `${this.len}px ${this.len}px`, 'stroke-dashoffset': `${((100 - this.percent) / 100 * this.len)}px`, 'transition': 'stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease' - } + }; }, wrapClasses () { return `${prefixCls}`; @@ -79,5 +79,5 @@ return `${prefixCls}-inner`; } } - } - \ No newline at end of file + }; + diff --git a/src/components/collapse/collapse.vue b/src/components/collapse/collapse.vue index 7b29b86..2fd163d 100644 --- a/src/components/collapse/collapse.vue +++ b/src/components/collapse/collapse.vue @@ -40,7 +40,7 @@ child.isActive = isActive; child.index = index; - }) + }); }, getActiveKey () { let activeKey = this.activeKey || []; @@ -94,5 +94,5 @@ this.setActive(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/collapse/panel.vue b/src/components/collapse/panel.vue index d9cae42..6b28805 100644 --- a/src/components/collapse/panel.vue +++ b/src/components/collapse/panel.vue @@ -24,7 +24,7 @@ return { index: 0, // use index for default when key is null isActive: false - } + }; }, computed: { itemClasses () { @@ -33,7 +33,7 @@ { [`${prefixCls}-item-active`]: this.isActive } - ] + ]; }, headerClasses () { return `${prefixCls}-header`; @@ -53,5 +53,5 @@ }); } } - } - \ No newline at end of file + }; + diff --git a/src/components/date-picker/base/confirm.vue b/src/components/date-picker/base/confirm.vue index c29d435..e7f05a4 100644 --- a/src/components/date-picker/base/confirm.vue +++ b/src/components/date-picker/base/confirm.vue @@ -14,7 +14,7 @@ data () { return { prefixCls: prefixCls - } + }; }, methods: { handleClear () { @@ -24,5 +24,5 @@ this.$emit('on-pick-success'); } } - } - \ No newline at end of file + }; + diff --git a/src/components/date-picker/base/date-table.vue b/src/components/date-picker/base/date-table.vue index db75489..99c0175 100644 --- a/src/components/date-picker/base/date-table.vue +++ b/src/components/date-picker/base/date-table.vue @@ -10,7 +10,7 @@ \ No newline at end of file + }; + diff --git a/src/components/date-picker/base/month-table.vue b/src/components/date-picker/base/month-table.vue index e822630..16a4c92 100644 --- a/src/components/date-picker/base/month-table.vue +++ b/src/components/date-picker/base/month-table.vue @@ -23,7 +23,7 @@ return [ `${prefixCls}`, `${prefixCls}-month` - ] + ]; }, cells () { let cells = []; @@ -56,7 +56,7 @@ [`${prefixCls}-cell-selected`]: cell.selected, [`${prefixCls}-cell-disabled`]: cell.disabled } - ] + ]; }, handleClick (event) { const target = event.target; @@ -70,5 +70,5 @@ this.$emit('on-pick-click'); } } - } - \ No newline at end of file + }; + diff --git a/src/components/date-picker/base/year-table.vue b/src/components/date-picker/base/year-table.vue index f3d3403..ef6f1fb 100644 --- a/src/components/date-picker/base/year-table.vue +++ b/src/components/date-picker/base/year-table.vue @@ -21,7 +21,7 @@ return [ `${prefixCls}`, `${prefixCls}-year` - ] + ]; }, startYear() { return Math.floor(this.year / 10) * 10; @@ -57,7 +57,7 @@ [`${prefixCls}-cell-selected`]: cell.selected, [`${prefixCls}-cell-disabled`]: cell.disabled } - ] + ]; }, nextTenYear() { this.$emit('on-pick', Number(this.year) + 10, false); @@ -76,5 +76,5 @@ this.$emit('on-pick-click'); } } - } - \ No newline at end of file + }; + diff --git a/src/components/date-picker/panel/date-range.vue b/src/components/date-picker/panel/date-range.vue index 04c2dff..e446166 100644 --- a/src/components/date-picker/panel/date-range.vue +++ b/src/components/date-picker/panel/date-range.vue @@ -157,7 +157,7 @@ selectionMode: 'range', leftTableYear: null, rightTableYear: null - } + }; }, computed: { classes () { @@ -167,7 +167,7 @@ { [`${prefixCls}-with-sidebar`]: this.shortcuts.length } - ] + ]; }, leftYear () { return this.date.getFullYear(); @@ -353,5 +353,5 @@ this.rangeState = val.rangeState; } } - } - \ No newline at end of file + }; + diff --git a/src/components/date-picker/panel/date.vue b/src/components/date-picker/panel/date.vue index dac999f..6657b61 100644 --- a/src/components/date-picker/panel/date.vue +++ b/src/components/date-picker/panel/date.vue @@ -73,7 +73,6 @@ import YearTable from '../base/year-table.vue'; import MonthTable from '../base/month-table.vue'; import Confirm from '../base/confirm.vue'; - import { formatDate, parseDate } from '../util'; import Mixin from './mixin'; @@ -97,7 +96,7 @@ year: null, month: null, confirm: false - } + }; }, computed: { classes () { @@ -106,7 +105,7 @@ { [`${prefixCls}-with-sidebar`]: this.shortcuts.length } - ] + ]; }, yearLabel () { const year = this.year; @@ -238,5 +237,5 @@ this.month = this.date.getMonth(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/date-picker/panel/mixin.js b/src/components/date-picker/panel/mixin.js index c944218..bc93a9c 100644 --- a/src/components/date-picker/panel/mixin.js +++ b/src/components/date-picker/panel/mixin.js @@ -8,7 +8,7 @@ export default { `${prefixCls}-icon-btn`, `${datePrefixCls}-${direction}-btn`, `${datePrefixCls}-${direction}-btn-arrow${type}`, - ] + ]; }, handleShortcutClick (shortcut) { if (shortcut.value) this.$emit('on-pick', shortcut.value()); @@ -24,4 +24,4 @@ export default { this.$emit('on-pick-click'); } } -} \ No newline at end of file +}; diff --git a/src/components/date-picker/picker.vue b/src/components/date-picker/picker.vue index badc67b..7b3933b 100644 --- a/src/components/date-picker/picker.vue +++ b/src/components/date-picker/picker.vue @@ -193,7 +193,7 @@ picker: null, internalValue: '', disableClickOutSide: false // fixed when click a date,trigger clickoutside to close picker - } + }; }, computed: { opened () { @@ -424,5 +424,5 @@ ready () { if (this.open !== null) this.visible = this.open; } - } - \ No newline at end of file + }; + diff --git a/src/components/date-picker/picker/date-picker.js b/src/components/date-picker/picker/date-picker.js index 2c8cbb9..8e0a33c 100644 --- a/src/components/date-picker/picker/date-picker.js +++ b/src/components/date-picker/picker/date-picker.js @@ -33,4 +33,4 @@ export default { this.panel = getPanel(this.type); } -} \ No newline at end of file +}; diff --git a/src/components/dropdown/dropdown-item.vue b/src/components/dropdown/dropdown-item.vue index 4265775..64390dd 100644 --- a/src/components/dropdown/dropdown-item.vue +++ b/src/components/dropdown/dropdown-item.vue @@ -31,7 +31,7 @@ [`${prefixCls}-selected`]: this.selected, [`${prefixCls}-divided`]: this.divided } - ] + ]; } }, methods: { @@ -53,5 +53,5 @@ $parent.$emit('on-click', this.key); } } - } - \ No newline at end of file + }; + diff --git a/src/components/dropdown/dropdown-menu.vue b/src/components/dropdown/dropdown-menu.vue index 84c9882..1621fb8 100644 --- a/src/components/dropdown/dropdown-menu.vue +++ b/src/components/dropdown/dropdown-menu.vue @@ -2,5 +2,5 @@ \ No newline at end of file + export default {}; + diff --git a/src/components/dropdown/dropdown.vue b/src/components/dropdown/dropdown.vue index 0ce63ae..8eecd8d 100644 --- a/src/components/dropdown/dropdown.vue +++ b/src/components/dropdown/dropdown.vue @@ -42,7 +42,7 @@ return { prefixCls: prefixCls, visible: false - } + }; }, methods: { handleClick () { @@ -120,5 +120,5 @@ if ($parent) $parent.$emit('on-haschild-click'); } } - } - \ No newline at end of file + }; + diff --git a/src/components/icon/icon.vue b/src/components/icon/icon.vue index d79c030..787df6c 100644 --- a/src/components/icon/icon.vue +++ b/src/components/icon/icon.vue @@ -12,21 +12,21 @@ }, computed: { classes () { - return `${prefixCls} ${prefixCls}-${this.type}` + return `${prefixCls} ${prefixCls}-${this.type}`; }, styles () { let style = {}; - if (!!this.size) { + if (this.size) { style['font-size'] = `${this.size}px`; } - if (!!this.color) { + if (this.color) { style.color = this.color; } return style; } } - } - \ No newline at end of file + }; + diff --git a/src/components/input-number/input-number.vue b/src/components/input-number/input-number.vue index 20f472e..8fe6d8d 100644 --- a/src/components/input-number/input-number.vue +++ b/src/components/input-number/input-number.vue @@ -39,13 +39,13 @@ function addNum (num1, num2) { let sq1, sq2, m; try { - sq1 = num1.toString().split(".")[1].length; + sq1 = num1.toString().split('.')[1].length; } catch (e) { sq1 = 0; } try { - sq2 = num2.toString().split(".")[1].length; + sq2 = num2.toString().split('.')[1].length; } catch (e) { sq2 = 0; @@ -93,7 +93,7 @@ focused: false, upDisabled: false, downDisabled: false - } + }; }, computed: { wrapClasses () { @@ -104,7 +104,7 @@ [`${prefixCls}-disabled`]: this.disabled, [`${prefixCls}-focused`]: this.focused } - ] + ]; }, handlerClasses () { return `${prefixCls}-handler-wrap`; @@ -116,7 +116,7 @@ { [`${prefixCls}-handler-up-disabled`]: this.upDisabled } - ] + ]; }, innerUpClasses () { return `${prefixCls}-handler-up-inner ${iconPrefixCls} ${iconPrefixCls}-ios-arrow-up`; @@ -128,7 +128,7 @@ { [`${prefixCls}-handler-down-disabled`]: this.downDisabled } - ] + ]; }, innerDownClasses () { return `${prefixCls}-handler-down-inner ${iconPrefixCls} ${iconPrefixCls}-ios-arrow-down`; @@ -190,10 +190,10 @@ keyDown (e) { if (e.keyCode === 38) { e.preventDefault(); - this.up() + this.up(); } else if (e.keyCode === 40) { e.preventDefault(); - this.down() + this.down(); } }, change (event) { @@ -238,5 +238,5 @@ this.changeVal(val); } } - } + }; diff --git a/src/components/input/input.vue b/src/components/input/input.vue index 9b989e8..6f9caf1 100644 --- a/src/components/input/input.vue +++ b/src/components/input/input.vue @@ -96,7 +96,7 @@ append: true, slotReady: false, textareaStyles: {} - } + }; }, computed: { wrapClasses () { @@ -108,7 +108,7 @@ [`${prefixCls}-group`]: this.prepend || this.append, [`${prefixCls}-group-${this.size}`]: (this.prepend || this.append) && !!this.size } - ] + ]; }, inputClasses () { return [ @@ -117,7 +117,7 @@ [`${prefixCls}-${this.size}`]: !!this.size, [`${prefixCls}-disabled`]: this.disabled } - ] + ]; }, textareaClasses () { return [ @@ -125,7 +125,7 @@ { [`${prefixCls}-disabled`]: this.disabled } - ] + ]; } }, methods: { @@ -174,5 +174,5 @@ this.slotReady = true; this.resizeTextarea(); } - } - \ No newline at end of file + }; + diff --git a/src/components/layout/col.vue b/src/components/layout/col.vue index 52d7731..7e05b81 100644 --- a/src/components/layout/col.vue +++ b/src/components/layout/col.vue @@ -4,8 +4,6 @@ \ No newline at end of file + }; + diff --git a/src/components/layout/row.vue b/src/components/layout/row.vue index 43bde58..c9890ce 100644 --- a/src/components/layout/row.vue +++ b/src/components/layout/row.vue @@ -41,7 +41,7 @@ [`${prefixCls}-${this.type}-${this.justify}`]: !!this.justify, [`${this.className}`]: !!this.className } - ] + ]; }, styles () { let style = {}; @@ -49,7 +49,7 @@ style = { marginLeft: this.gutter / -2 + 'px', marginRight: this.gutter / -2 + 'px' - } + }; } return style; @@ -72,5 +72,5 @@ ready () { this.updateGutter(this.gutter); } - } - \ No newline at end of file + }; + diff --git a/src/components/loading-bar/index.js b/src/components/loading-bar/index.js index c6b031a..237123a 100644 --- a/src/components/loading-bar/index.js +++ b/src/components/loading-bar/index.js @@ -31,7 +31,7 @@ function hide() { update({ percent: 0 }); - }, 200) + }, 200); }, 800); } @@ -109,4 +109,4 @@ export default { loadingBarInstance = null; instance.destroy(); } -} \ No newline at end of file +}; diff --git a/src/components/loading-bar/loading-bar.js b/src/components/loading-bar/loading-bar.js index 0619c7b..e978fb4 100644 --- a/src/components/loading-bar/loading-bar.js +++ b/src/components/loading-bar/loading-bar.js @@ -36,7 +36,7 @@ LoadingBar.newInstance = properties => { destroy () { document.body.removeChild(div); } - } + }; }; export default LoadingBar; diff --git a/src/components/loading-bar/loading-bar.vue b/src/components/loading-bar/loading-bar.vue index c627319..23d4278 100644 --- a/src/components/loading-bar/loading-bar.vue +++ b/src/components/loading-bar/loading-bar.vue @@ -49,12 +49,12 @@ [`${prefixCls}-inner-color-primary`]: this.color === 'primary' && this.status === 'success', [`${prefixCls}-inner-failed-color-error`]: this.failedColor === 'error' && this.status === 'error' } - ] + ]; }, outerStyles () { return { height: `${this.height}px` - } + }; }, styles () { let style = { @@ -73,5 +73,5 @@ return style; } } - } - \ No newline at end of file + }; + diff --git a/src/components/menu/menu-group.vue b/src/components/menu/menu-group.vue index bd4dc62..83c44c8 100644 --- a/src/components/menu/menu-group.vue +++ b/src/components/menu/menu-group.vue @@ -18,7 +18,7 @@ data () { return { prefixCls: prefixCls - } + }; } - } - \ No newline at end of file + }; + diff --git a/src/components/menu/menu-item.vue b/src/components/menu/menu-item.vue index 92eecda..b3383d6 100644 --- a/src/components/menu/menu-item.vue +++ b/src/components/menu/menu-item.vue @@ -19,7 +19,7 @@ data () { return { active: false - } + }; }, computed: { classes () { @@ -30,7 +30,7 @@ [`${prefixCls}-item-selected`]: this.active, [`${prefixCls}-item-disabled`]: this.disabled } - ] + ]; } }, methods: { @@ -39,5 +39,5 @@ this.$dispatch('on-menu-item-select', this.key); } } - } - \ No newline at end of file + }; + diff --git a/src/components/menu/menu.vue b/src/components/menu/menu.vue index fcc80f5..46f025b 100644 --- a/src/components/menu/menu.vue +++ b/src/components/menu/menu.vue @@ -26,7 +26,7 @@ openKeys: { type: Array, default () { - return [] + return []; } }, accordion: { @@ -49,7 +49,7 @@ { [`${prefixCls}-${this.mode}`]: this.mode } - ] + ]; }, styles () { let style = {}; @@ -77,7 +77,7 @@ } else { groupItem.active = false; } - }) + }); } else if (subitem.$options.name === 'MenuItem') { if (subitem.key === this.activeKey) { subitem.active = true; @@ -86,15 +86,15 @@ subitem.active = false; } } - }) + }); } else if (item.$options.name === 'MenuGroup') { item.$children.forEach(groupItem => { groupItem.active = groupItem.key === this.activeKey; - }) + }); } else if (item.$options.name === 'MenuItem') { item.active = item.key === this.activeKey; } - }) + }); }, updateOpenKeys (key) { const index = this.openKeys.indexOf(key); @@ -109,7 +109,7 @@ if (item.$options.name === 'Submenu') { if (this.openKeys.indexOf(item.key) > -1) item.opened = true; } - }) + }); } }, compiled () { @@ -128,5 +128,5 @@ this.$emit('on-open-change', this.openKeys); } } - } - \ No newline at end of file + }; + diff --git a/src/components/menu/submenu.vue b/src/components/menu/submenu.vue index db4dbb7..9d348a3 100644 --- a/src/components/menu/submenu.vue +++ b/src/components/menu/submenu.vue @@ -31,7 +31,7 @@ prefixCls: prefixCls, active: false, opened: false - } + }; }, computed: { classes () { @@ -42,7 +42,7 @@ [`${prefixCls}-opened`]: this.opened, [`${prefixCls}-submenu-disabled`]: this.disabled } - ] + ]; }, mode () { return this.$parent.mode; @@ -106,5 +106,5 @@ return true; } } - } - \ No newline at end of file + }; + diff --git a/src/components/message/index.js b/src/components/message/index.js index a383804..1685be9 100644 --- a/src/components/message/index.js +++ b/src/components/message/index.js @@ -32,7 +32,7 @@ function notice (content, duration = defaultDuration, type, onClose) { if (!onClose) { onClose = function () { - } + }; } const iconType = iconTypes[type]; @@ -61,7 +61,7 @@ function notice (content, duration = defaultDuration, type, onClose) { return function () { instance.remove(`${prefixKey}${target}`); - } + }; })(); } @@ -94,4 +94,4 @@ export default { messageInstance = null; instance.destroy(); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/components/modal/confirm.js b/src/components/modal/confirm.js index b943dcb..cba0875 100644 --- a/src/components/modal/confirm.js +++ b/src/components/modal/confirm.js @@ -55,13 +55,13 @@ Modal.newInstance = properties => { return [ `${prefixCls}-body-icon`, `${prefixCls}-body-icon-${this.iconType}` - ] + ]; }, iconNameCls () { return [ 'ivu-icon', `ivu-icon-${this.iconName}` - ] + ]; } }, methods: { @@ -163,7 +163,7 @@ Modal.newInstance = properties => { modal.$parent.remove(); }, component: modal - } + }; }; export default Modal; \ No newline at end of file diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue index 956b856..a5fa8a3 100644 --- a/src/components/modal/modal.vue +++ b/src/components/modal/modal.vue @@ -79,7 +79,7 @@ wrapShow: false, showHead: true, buttonLoading: false - } + }; }, computed: { wrapClasses () { @@ -89,7 +89,7 @@ [`${prefixCls}-hidden`]: !this.wrapShow, [`${this.className}`]: !!this.className } - ] + ]; }, maskClasses () { return `${prefixCls}-mask`; @@ -104,7 +104,7 @@ width: `${this.width}px` }; - const customStyle = !!this.style ? this.style : {}; + const customStyle = this.style ? this.style : {}; Object.assign(style, styleWidth, customStyle); @@ -135,7 +135,7 @@ EscClose (e) { if (this.visible && this.closable) { if (e.keyCode === 27) { - this.close() + this.close(); } } }, @@ -207,5 +207,5 @@ } } } - } + }; diff --git a/src/components/notice/index.js b/src/components/notice/index.js index 04e2874..3e7eda9 100644 --- a/src/components/notice/index.js +++ b/src/components/notice/index.js @@ -114,4 +114,4 @@ export default { noticeInstance = null; instance.destroy(); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/components/page/options.vue b/src/components/page/options.vue index 0d5e441..0055ad9 100644 --- a/src/components/page/options.vue +++ b/src/components/page/options.vue @@ -41,17 +41,17 @@ optsClasses () { return [ `${prefixCls}-options` - ] + ]; }, sizerClasses () { return [ `${prefixCls}-options-sizer` - ] + ]; }, ElevatorClasses () { return [ `${prefixCls}-options-elevator` - ] + ]; } }, methods: { @@ -83,5 +83,5 @@ } } } - } - \ No newline at end of file + }; + diff --git a/src/components/page/page.vue b/src/components/page/page.vue index cc61b35..bba3477 100644 --- a/src/components/page/page.vue +++ b/src/components/page/page.vue @@ -86,7 +86,7 @@ pageSizeOpts: { type: Array, default () { - return [10, 20, 30, 40] + return [10, 20, 30, 40]; } }, size: { @@ -120,7 +120,7 @@ data () { return { prefixCls: prefixCls - } + }; }, computed: { isSmall () { @@ -137,7 +137,7 @@ { [`${this.class}`]: !!this.class } - ] + ]; }, simplePagerClasses () { return `${prefixCls}-simple-pager`; @@ -149,7 +149,7 @@ [`${this.class}`]: !!this.class, 'mini': !!this.size } - ] + ]; }, prevClasses () { return [ @@ -157,7 +157,7 @@ { [`${prefixCls}-disabled`]: this.current === 1 } - ] + ]; }, nextClasses () { return [ @@ -165,7 +165,7 @@ { [`${prefixCls}-disabled`]: this.current === this.allPages } - ] + ]; }, firstPageClasses () { return [ @@ -173,7 +173,7 @@ { [`${prefixCls}-item-active`]: this.current === 1 } - ] + ]; }, lastPageClasses () { return [ @@ -181,7 +181,7 @@ { [`${prefixCls}-item-active`]: this.current === this.allPages } - ] + ]; } }, methods: { @@ -242,9 +242,9 @@ const val = parseInt(e.target.value); if (key === 38) { - this.prev() + this.prev(); } else if (key === 40) { - this.next() + this.next(); } else if (key == 13) { let page = 1; @@ -261,5 +261,5 @@ } } } - } + }; diff --git a/src/components/poptip/poptip.vue b/src/components/poptip/poptip.vue index 79b760d..7e7ca77 100644 --- a/src/components/poptip/poptip.vue +++ b/src/components/poptip/poptip.vue @@ -87,7 +87,7 @@ return { prefixCls: prefixCls, showTitle: true - } + }; }, computed: { classes () { @@ -96,12 +96,12 @@ { [`${prefixCls}-confirm`]: this.confirm } - ] + ]; }, styles () { let style = {}; - if (!!this.width) { + if (this.width) { style.width = `${this.width}px`; } return style; @@ -166,5 +166,5 @@ this.showTitle = this.$els.title.innerHTML != `
`; } } - } + }; diff --git a/src/components/progress/progress.vue b/src/components/progress/progress.vue index 256c4a0..16a08b3 100644 --- a/src/components/progress/progress.vue +++ b/src/components/progress/progress.vue @@ -56,7 +56,7 @@ type = 'ios-close'; break; case 'success': - type = 'ios-checkmark'; + type = 'ios-checkmark'; break; } @@ -66,7 +66,7 @@ return { width: `${this.percent}%`, height: `${this.strokeWidth}px` - } + }; }, wrapClasses () { return [ @@ -76,7 +76,7 @@ [`${prefixCls}-show-info`]: !this.hideInfo, } - ] + ]; }, textClasses () { return `${prefixCls}-text`; @@ -117,5 +117,5 @@ } } } - } - \ No newline at end of file + }; + diff --git a/src/components/radio/radio-group.vue b/src/components/radio/radio-group.vue index 0a1f22e..4f1983b 100644 --- a/src/components/radio/radio-group.vue +++ b/src/components/radio/radio-group.vue @@ -33,7 +33,7 @@ [`${prefixCls}-${this.size}`]: !!this.size, [`${prefixCls}-${this.type}`]: !!this.type } - ] + ]; } }, compiled () { @@ -55,8 +55,8 @@ }, watch: { model () { - this.updateModel() + this.updateModel(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/radio/radio.vue b/src/components/radio/radio.vue index 715d604..9d96470 100644 --- a/src/components/radio/radio.vue +++ b/src/components/radio/radio.vue @@ -32,7 +32,7 @@ return { selected: false, group: false - } + }; }, computed: { wrapClasses () { @@ -43,7 +43,7 @@ [`${prefixCls}-wrapper-checked`]: this.selected, [`${prefixCls}-wrapper-disabled`]: this.disabled } - ] + ]; }, radioClasses () { return [ @@ -52,7 +52,7 @@ [`${prefixCls}-checked`]: this.selected, [`${prefixCls}-disabled`]: this.disabled } - ] + ]; }, innerClasses () { return `${prefixCls}-inner`; @@ -91,5 +91,5 @@ this.updateModel(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/select/dropdown.vue b/src/components/select/dropdown.vue index 09b00fd..05cc3a3 100644 --- a/src/components/select/dropdown.vue +++ b/src/components/select/dropdown.vue @@ -14,7 +14,7 @@ data () { return { popper: null - } + }; }, methods: { update () { @@ -62,5 +62,5 @@ this.popper.destroy(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/select/option-group.vue b/src/components/select/option-group.vue index fa63b26..b47f07e 100644 --- a/src/components/select/option-group.vue +++ b/src/components/select/option-group.vue @@ -19,7 +19,7 @@ data () { return { prefixCls: prefixCls - } + }; } - } + }; diff --git a/src/components/select/option.vue b/src/components/select/option.vue index f038a03..932008b 100644 --- a/src/components/select/option.vue +++ b/src/components/select/option.vue @@ -26,7 +26,7 @@ isFocus: false, hidden: false, // for search searchLabel: '' // the value is slot,only for search - } + }; }, computed: { classes () { @@ -37,10 +37,10 @@ [`${prefixCls}-selected`]: this.selected, [`${prefixCls}-focus`]: this.isFocus } - ] + ]; }, showLabel () { - return (!!this.label) ? this.label : this.value; + return (this.label) ? this.label : this.value; } }, methods: { @@ -69,5 +69,5 @@ this.queryChange(val); } } - } - \ No newline at end of file + }; + diff --git a/src/components/select/select.vue b/src/components/select/select.vue index f6d6e7a..8208b34 100644 --- a/src/components/select/select.vue +++ b/src/components/select/select.vue @@ -96,7 +96,7 @@ inputLength: 20, notFound: false, slotChangeDuration: false // if slot change duration and in multiple, set true and after slot change, set false - } + }; }, computed: { classes () { @@ -110,7 +110,7 @@ [`${prefixCls}-show-clear`]: this.showCloseIcon, [`${prefixCls}-${this.size}`]: !!this.size } - ] + ]; }, showPlaceholder () { let status = false; @@ -174,7 +174,7 @@ if (this.optionInstances.length) { this.optionInstances.forEach((child) => { find(child); - }) + }); } else { this.$children.forEach((child) => { find(child); @@ -252,7 +252,7 @@ selected.push({ value: option.value, label: option.label - }) + }); } } } @@ -435,7 +435,7 @@ const model = this.model; if (this.multiple) { - + // } else { if (model !== '') { this.findChild((child) => { @@ -561,5 +561,5 @@ } } } - } + }; diff --git a/src/components/slider/slider.vue b/src/components/slider/slider.vue index a7b389a..951d4ee 100644 --- a/src/components/slider/slider.vue +++ b/src/components/slider/slider.vue @@ -109,7 +109,7 @@ singlePosition: (this.value - this.min) / (this.max - this.min) * 100, firstPosition: (this.value[0] - this.min) / (this.max - this.min) * 100, secondPosition: (this.value[1] - this.min) / (this.max - this.min) * 100 - } + }; }, computed: { classes () { @@ -120,7 +120,7 @@ [`${prefixCls}-range`]: this.range, [`${prefixCls}-disabled`]: this.disabled } - ] + ]; }, buttonClasses () { return [ @@ -153,11 +153,11 @@ style = { width: (this.value[1] - this.value[0]) / (this.max - this.min) * 100 + '%', left: (this.value[0] - this.min) / (this.max - this.min) * 100 + '%' - } + }; } else { style = { width: (this.value - this.min) / (this.max - this.min) * 100 + '%' - } + }; } return style; @@ -418,5 +418,5 @@ this.updateValue(this.value); } } - } - \ No newline at end of file + }; + diff --git a/src/components/spin/spin.vue b/src/components/spin/spin.vue index d91d137..6adb76c 100644 --- a/src/components/spin/spin.vue +++ b/src/components/spin/spin.vue @@ -26,7 +26,7 @@ data () { return { showText: false - } + }; }, computed: { classes () { @@ -37,7 +37,7 @@ [`${prefixCls}-fix`]: this.fix, [`${prefixCls}-show-text`]: this.showText, } - ] + ]; }, mainClasses () { return `${prefixCls}-main`; @@ -56,5 +56,5 @@ this.showText = true; } } - } - \ No newline at end of file + }; + diff --git a/src/components/steps/step.vue b/src/components/steps/step.vue index 6cc6a8d..7a211fc 100644 --- a/src/components/steps/step.vue +++ b/src/components/steps/step.vue @@ -43,7 +43,7 @@ stepNumber: '', nextError: false, total: 1 - } + }; }, computed: { wrapClasses () { @@ -54,12 +54,12 @@ [`${prefixCls}-custom`]: !!this.icon, [`${prefixCls}-next-error`]: this.nextError } - ] + ]; }, iconClasses () { let icon = ''; - if (!!this.icon) { + if (this.icon) { icon = this.icon; } else { if (this.status == 'finish') { @@ -75,12 +75,12 @@ { [`${iconPrefixCls}-${icon}`]: icon != '' } - ] + ]; }, styles () { return { width: `${1/this.total*100}%` - } + }; } }, watch: { @@ -90,5 +90,5 @@ } } } - } + }; diff --git a/src/components/steps/steps.vue b/src/components/steps/steps.vue index f1992cf..53a0440 100644 --- a/src/components/steps/steps.vue +++ b/src/components/steps/steps.vue @@ -40,7 +40,7 @@ { [`${prefixCls}-${this.size}`]: !!this.size } - ] + ]; } }, ready () { @@ -103,5 +103,5 @@ this.updateCurrent(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/switch/switch.vue b/src/components/switch/switch.vue index 48380d0..391fa3f 100644 --- a/src/components/switch/switch.vue +++ b/src/components/switch/switch.vue @@ -36,7 +36,7 @@ [`${prefixCls}-disabled`]: this.disabled, [`${prefixCls}-${this.size}`]: !!this.size } - ] + ]; }, innerClasses () { return `${prefixCls}-inner`; @@ -52,5 +52,5 @@ this.$emit('on-change', this.checked); } } - } - \ No newline at end of file + }; + diff --git a/src/components/table/cell.vue b/src/components/table/cell.vue index ab92b72..2c17edb 100644 --- a/src/components/table/cell.vue +++ b/src/components/table/cell.vue @@ -29,7 +29,7 @@ renderType: '', uid: -1, content: this.$parent.$parent.content - } + }; }, computed: { classes () { @@ -38,7 +38,7 @@ { [`${this.prefixCls}-hidden`]: !this.fixed && this.column.fixed && (this.column.fixed === 'left' || this.column.fixed === 'right') } - ] + ]; } }, methods: { @@ -94,5 +94,5 @@ this.compile(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/table/export-csv.js b/src/components/table/export-csv.js index 92451ce..3599eb6 100644 --- a/src/components/table/export-csv.js +++ b/src/components/table/export-csv.js @@ -3,11 +3,11 @@ function has (browser) { if (browser === 'ie') { const isIE = ua.indexOf('compatible') > -1 && ua.indexOf('MSIE') > -1; if (isIE) { - const reIE = new RegExp("MSIE (\\d+\\.\\d+);"); + const reIE = new RegExp('MSIE (\\d+\\.\\d+);'); reIE.test(ua); - return parseFloat(RegExp["$1"]); + return parseFloat(RegExp['$1']); } else { - return false + return false; } } else { return ua.indexOf(browser) > -1; @@ -19,12 +19,12 @@ const csv = { let iev = 0; const ieold = (/MSIE (\d+\.\d+);/.test(navigator.userAgent)); const trident = !!navigator.userAgent.match(/Trident\/7.0/); - const rv = navigator.userAgent.indexOf("rv:11.0"); + const rv = navigator.userAgent.indexOf('rv:11.0'); if (ieold) { iev = Number(RegExp.$1); } - if (navigator.appVersion.indexOf("MSIE 10") !== -1) { + if (navigator.appVersion.indexOf('MSIE 10') !== -1) { iev = 10; } if (trident && rv !== -1) { @@ -39,7 +39,7 @@ const csv = { }, _getDownloadUrl (text) { - const BOM = "\uFEFF"; + const BOM = '\uFEFF'; // Add BOM to text for open in excel correctly if (window.Blob && window.URL && window.URL.createObjectURL && !has('Safari')) { const csvData = new Blob([BOM + text], { type: 'text/csv' }); @@ -52,14 +52,14 @@ const csv = { download (filename, text) { if (has('ie') && has('ie') < 10) { // has module unable identify ie11 and Edge - const oWin = window.top.open("about:blank", "_blank"); + const oWin = window.top.open('about:blank', '_blank'); oWin.document.charset = 'utf-8'; oWin.document.write(text); oWin.document.close(); oWin.document.execCommand('SaveAs', filename); oWin.close(); - } else if (has("ie") === 10 || this._isIE11() || this._isEdge()) { - const BOM = "\uFEFF"; + } else if (has('ie') === 10 || this._isIE11() || this._isEdge()) { + const BOM = '\uFEFF'; const csvData = new Blob([BOM + text], { type: 'text/csv' }); navigator.msSaveBlob(csvData, filename); } else { diff --git a/src/components/table/mixin.js b/src/components/table/mixin.js index 450769a..cef16e8 100644 --- a/src/components/table/mixin.js +++ b/src/components/table/mixin.js @@ -6,21 +6,21 @@ export default { [`${this.prefixCls}-column-${column.align}`]: column.align, [`${this.prefixCls}-hidden`]: (this.fixed === 'left' && column.fixed !== 'left') || (this.fixed === 'right' && column.fixed !== 'right') || (!this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right')) } - ] + ]; }, isPopperShow (column) { return column.filters && ((!this.fixed && !column.fixed) || (this.fixed === 'left' && column.fixed === 'left') || (this.fixed === 'right' && column.fixed === 'right')); }, - setCellWidth (column, index) { + setCellWidth (column) { // return column.width ? column.width : this.columnsWidth[index]; let width = ''; if (column.width) { width = column.width; } else if (this.columnsWidth[column._index]) { - width = this.columnsWidth[column._index].width + width = this.columnsWidth[column._index].width; } // return this.columnsWidth[column._index] ? this.columnsWidth[column._index].width : ''; return width; } } -} \ No newline at end of file +}; diff --git a/src/components/table/table-body.vue b/src/components/table/table-body.vue index 02e90da..f4d78ff 100644 --- a/src/components/table/table-body.vue +++ b/src/components/table/table-body.vue @@ -52,7 +52,7 @@ [`${this.prefixCls}-row-highlight`]: this.objData[_index] && this.objData[_index]._isHighlight, [`${this.prefixCls}-row-hover`]: this.objData[_index] && this.objData[_index]._isHover } - ] + ]; }, rowChecked (_index) { return this.objData[_index] && this.objData[_index]._isChecked; @@ -70,5 +70,5 @@ this.$parent.highlightCurrentRow(_index); } } - } - \ No newline at end of file + }; + diff --git a/src/components/table/table-head.vue b/src/components/table/table-head.vue index 1b09f72..d09e153 100644 --- a/src/components/table/table-head.vue +++ b/src/components/table/table-head.vue @@ -58,7 +58,6 @@ import Poptip from '../poptip/poptip.vue'; import iButton from '../button/button.vue'; import Mixin from './mixin'; - import { deepCopy } from '../../utils/assist'; export default { mixins: [ Mixin ], @@ -97,7 +96,7 @@ { [`${this.prefixCls}-hidden`]: !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right') } - ] + ]; }, itemClasses (column, item) { return [ @@ -105,7 +104,7 @@ { [`${this.prefixCls}-filter-select-item-selected`]: column._filterChecked[0] === item.value } - ] + ]; }, itemAllClasses (column) { return [ @@ -113,7 +112,7 @@ { [`${this.prefixCls}-filter-select-item-selected`]: !column._filterChecked.length } - ] + ]; }, renderHeader (column, $index) { if ('renderHeader' in this.columns[$index]) { @@ -145,5 +144,5 @@ this.$parent.handleFilterHide(index); } } - } - \ No newline at end of file + }; + diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 9b3af6e..4ddc4f5 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -83,13 +83,13 @@ data: { type: Array, default () { - return [] + return []; } }, columns: { type: Array, default () { - return [] + return []; } }, size: { @@ -142,7 +142,7 @@ showSlotHeader: true, showSlotFooter: true, bodyHeight: 0 - } + }; }, computed: { wrapClasses () { @@ -153,7 +153,7 @@ [`${prefixCls}-with-header`]: this.showSlotHeader, [`${prefixCls}-with-footer`]: this.showSlotFooter } - ] + ]; }, classes () { return [ @@ -164,12 +164,12 @@ [`${prefixCls}-stripe`]: this.stripe, [`${prefixCls}-with-fixed-top`]: !!this.height } - ] + ]; }, styles () { let style = {}; - if (!!this.height) style.height = `${this.height}px`; - if (!!this.width) style.width = `${this.width}px`; + if (this.height) style.height = `${this.height}px`; + if (this.width) style.width = `${this.width}px`; return style; }, tableStyle () { @@ -269,7 +269,7 @@ columnsWidth[column._index] = { width: width - } + }; } this.columnsWidth = columnsWidth; } @@ -334,13 +334,13 @@ this.$emit('on-selection-change', selection); }, fixedHeader () { - if (!!this.height) { + if (this.height) { this.$nextTick(() => { const titleHeight = parseInt(getStyle(this.$els.title, 'height')) || 0; const headerHeight = parseInt(getStyle(this.$els.header, 'height')) || 0; const footerHeight = parseInt(getStyle(this.$els.footer, 'height')) || 0; this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight; - }) + }); } else { this.bodyHeight = 0; } @@ -584,5 +584,5 @@ this.fixedHeader(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/tabs/pane.vue b/src/components/tabs/pane.vue index fcd12b0..fff167b 100644 --- a/src/components/tabs/pane.vue +++ b/src/components/tabs/pane.vue @@ -26,7 +26,7 @@ return { prefixCls: prefixCls, show: true - } + }; }, computed: { @@ -47,5 +47,5 @@ this.updateNav(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/tabs/tabs.vue b/src/components/tabs/tabs.vue index 6aa84ce..786d9aa 100644 --- a/src/components/tabs/tabs.vue +++ b/src/components/tabs/tabs.vue @@ -58,7 +58,7 @@ navList: [], barWidth: 0, barOffset: 0 - } + }; }, computed: { classes () { @@ -69,7 +69,7 @@ [`${prefixCls}-mini`]: this.size === 'small' && this.type === 'line', [`${prefixCls}-no-animation`]: !this.animated } - ] + ]; }, contentClasses () { return [ @@ -77,7 +77,7 @@ { [`${prefixCls}-content-animated`]: this.animated } - ] + ]; }, barClasses () { return [ @@ -85,17 +85,17 @@ { [`${prefixCls}-ink-bar-animated`]: this.animated } - ] + ]; }, contentStyle () { - const x = this.navList.findIndex((nav, index) => nav.key === this.activeKey); + const x = this.navList.findIndex((nav) => nav.key === this.activeKey); const p = x === 0 ? '0%' : `-${x}00%`; let style = {}; if (x > -1) { style = { transform: `translateX(${p}) translateZ(0px)` - } + }; } return style; }, @@ -137,7 +137,7 @@ }, updateBar () { this.$nextTick(() => { - const index = this.navList.findIndex((nav, index) => nav.key === this.activeKey); + const index = this.navList.findIndex((nav) => nav.key === this.activeKey); const prevTabs = this.$els.nav.querySelectorAll(`.${prefixCls}-tab`); const tab = prevTabs[index]; this.barWidth = parseFloat(getStyle(tab, 'width')); @@ -166,7 +166,7 @@ [`${prefixCls}-tab-disabled`]: item.disabled, [`${prefixCls}-tab-active`]: item.key === this.activeKey } - ] + ]; }, handleChange (index) { const nav = this.navList[index]; @@ -210,5 +210,5 @@ this.updateBar(); } } - } - \ No newline at end of file + }; + diff --git a/src/components/tag/tag.vue b/src/components/tag/tag.vue index 95f23a1..19936c3 100644 --- a/src/components/tag/tag.vue +++ b/src/components/tag/tag.vue @@ -30,7 +30,7 @@ data () { return { closed: false - } + }; }, computed: { classes () { @@ -41,7 +41,7 @@ [`${prefixCls}-${this.type}`]: !!this.type, [`${prefixCls}-closable`]: this.closable } - ] + ]; }, textClasses () { return `${prefixCls}-text`; @@ -59,5 +59,5 @@ this.$emit('on-close', e); } } - } - \ No newline at end of file + }; + diff --git a/src/components/timeline/timeline-item.vue b/src/components/timeline/timeline-item.vue index 92e2169..9ec47a1 100644 --- a/src/components/timeline/timeline-item.vue +++ b/src/components/timeline/timeline-item.vue @@ -20,7 +20,7 @@ data () { return { dot: false - } + }; }, ready () { this.dot = this.$els.dot.innerHTML.length ? true : false; @@ -39,7 +39,7 @@ [`${prefixCls}-item-head-custom`]: this.dot, [`${prefixCls}-item-head-${this.color}`]: this.headColorShow } - ] + ]; }, headColorShow () { return this.color == 'blue' || this.color == 'red' || this.color == 'green'; @@ -51,7 +51,7 @@ style = { 'color': this.color, 'border-color': this.color - } + }; } } @@ -61,5 +61,5 @@ return `${prefixCls}-item-content`; } } - } - \ No newline at end of file + }; + diff --git a/src/components/timeline/timeline.vue b/src/components/timeline/timeline.vue index 8062332..be31f0b 100644 --- a/src/components/timeline/timeline.vue +++ b/src/components/timeline/timeline.vue @@ -20,8 +20,8 @@ { [`${prefixCls}-pending`]: this.pending } - ] + ]; } } - } - \ No newline at end of file + }; + diff --git a/src/components/tooltip/tooltip.vue b/src/components/tooltip/tooltip.vue index dba9548..9045cc3 100644 --- a/src/components/tooltip/tooltip.vue +++ b/src/components/tooltip/tooltip.vue @@ -46,7 +46,7 @@ data () { return { prefixCls: prefixCls - } + }; }, methods: { handleShowPopper() { @@ -61,5 +61,5 @@ } } } - } + }; diff --git a/src/components/transfer/list.vue b/src/components/transfer/list.vue index 0d5d71f..e8e323e 100644 --- a/src/components/transfer/list.vue +++ b/src/components/transfer/list.vue @@ -50,7 +50,7 @@ showItems: [], query: '', showFooter: true - } + }; }, computed: { classes () { @@ -59,7 +59,7 @@ { [`${this.prefixCls}-with-footer`]: this.showFooter } - ] + ]; }, bodyClasses () { return [ @@ -68,7 +68,7 @@ [`${this.prefixCls}-body-with-search`]: this.filterable, [`${this.prefixCls}-body-with-footer`]: this.showFooter } - ] + ]; }, count () { const validKeysCount = this.validKeysCount; @@ -88,7 +88,7 @@ { [`${this.prefixCls}-content-item-disabled`]: item.disabled } - ] + ]; }, showLabel (item) { return this.renderFormat(item); @@ -125,5 +125,5 @@ this.updateFilteredData(); } } - } + }; diff --git a/src/components/transfer/operation.vue b/src/components/transfer/operation.vue index 085f853..06bdb37 100644 --- a/src/components/transfer/operation.vue +++ b/src/components/transfer/operation.vue @@ -28,5 +28,5 @@ this.$parent.moveTo('right'); } } - } + }; diff --git a/src/components/transfer/search.vue b/src/components/transfer/search.vue index e795a91..e7c4fec 100644 --- a/src/components/transfer/search.vue +++ b/src/components/transfer/search.vue @@ -29,5 +29,5 @@ this.query = ''; } } - } - \ No newline at end of file + }; + diff --git a/src/components/transfer/transfer.vue b/src/components/transfer/transfer.vue index 9ff7b48..0a50450 100644 --- a/src/components/transfer/transfer.vue +++ b/src/components/transfer/transfer.vue @@ -47,7 +47,7 @@ data: { type: Array, default () { - return [] + return []; } }, renderFormat: { @@ -59,31 +59,31 @@ targetKeys: { type: Array, default () { - return [] + return []; } }, selectedKeys: { type: Array, default () { - return [] + return []; } }, listStyle: { type: Object, default () { - return {} + return {}; } }, titles: { type: Array, default () { - return ['源列表', '目的列表'] + return ['源列表', '目的列表']; } }, operations: { type: Array, default () { - return [] + return []; } }, filterable: { @@ -113,13 +113,13 @@ rightData: [], leftCheckedKeys: [], rightCheckedKeys: [] - } + }; }, computed: { classes () { return [ `${prefixCls}` - ] + ]; }, leftValidKeysCount () { return this.getValidKeys('left').length; @@ -182,5 +182,5 @@ created () { this.splitData(true); } - } - \ No newline at end of file + }; + diff --git a/src/directives/clickoutside.js b/src/directives/clickoutside.js index 437f155..8bb0851 100644 --- a/src/directives/clickoutside.js +++ b/src/directives/clickoutside.js @@ -16,4 +16,4 @@ export default { unbind () { document.removeEventListener('click', this.documentHandler); } -} \ No newline at end of file +}; \ No newline at end of file diff --git a/src/index.js b/src/index.js index 3d8fe28..e6348ef 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ // es6 polyfill -import 'core-js/fn/array/find-index' +import 'core-js/fn/array/find-index'; import Affix from './components/affix'; import Alert from './components/alert'; @@ -97,7 +97,7 @@ const iview = { const install = function (Vue) { Object.keys(iview).forEach((key) => { - Vue.component(key, iview[key]) + Vue.component(key, iview[key]); }); Vue.prototype.$Loading = LoadingBar; @@ -111,4 +111,4 @@ if (typeof window !== 'undefined' && window.Vue) { install(window.Vue); } -module.exports = Object.assign(iview, {install}); +module.exports = Object.assign(iview, {install}); // eslint-disable-line no-undef diff --git a/src/utils/assist.js b/src/utils/assist.js index 65fc858..a457ec9 100644 --- a/src/utils/assist.js +++ b/src/utils/assist.js @@ -131,4 +131,4 @@ function deepCopy(data) { return o; } -export {deepCopy} \ No newline at end of file +export {deepCopy}; \ No newline at end of file diff --git a/src/utils/calcTextareaHeight.js b/src/utils/calcTextareaHeight.js index 5b39ea3..2a0febc 100644 --- a/src/utils/calcTextareaHeight.js +++ b/src/utils/calcTextareaHeight.js @@ -105,4 +105,4 @@ export default function calcTextareaHeight(targetNode, minRows = null, maxRows = minHeight: `${minHeight}px`, maxHeight: `${maxHeight}px` }; -}; \ No newline at end of file +} \ No newline at end of file -- libgit2 0.21.4