Commit b0893113b3b6781de46b13b82a9a24e74f1be04f
1 parent
829a2e4c
add eslint
Showing
88 changed files
with
376 additions
and
370 deletions
Show diff stats
1 | +{ | |
2 | + "root": true, | |
3 | + "parserOptions": { | |
4 | + "ecmaVersion": 6, | |
5 | + "sourceType": "module" | |
6 | + }, | |
7 | + "env": { | |
8 | + "browser": true | |
9 | + }, | |
10 | + "extends": "eslint:recommended", | |
11 | + "plugins": [ "html" ], | |
12 | + "rules": { | |
13 | + "indent": ["error", 4, { "SwitchCase": 1 }], | |
14 | + "quotes": ["error", "single"], | |
15 | + "semi": ["error", "always"], | |
16 | + "no-console": ["off"] | |
17 | + } | |
18 | +} | ... | ... |
.travis.yml
build/build-style.js
... | ... | @@ -6,20 +6,20 @@ var autoprefixer = require('gulp-autoprefixer'); |
6 | 6 | |
7 | 7 | // 编译less |
8 | 8 | gulp.task('css', function () { |
9 | - gulp.src('../src/styles/index.less') | |
10 | - .pipe(less()) | |
11 | - .pipe(autoprefixer({ | |
9 | + gulp.src('../src/styles/index.less') | |
10 | + .pipe(less()) | |
11 | + .pipe(autoprefixer({ | |
12 | 12 | browsers: ['last 2 versions', 'ie > 8'] |
13 | - })) | |
14 | - .pipe(cleanCSS()) | |
15 | - .pipe(rename('iview.css')) | |
16 | - .pipe(gulp.dest('../dist/styles')) | |
13 | + })) | |
14 | + .pipe(cleanCSS()) | |
15 | + .pipe(rename('iview.css')) | |
16 | + .pipe(gulp.dest('../dist/styles')); | |
17 | 17 | }); |
18 | 18 | |
19 | 19 | // 拷贝字体文件 |
20 | 20 | gulp.task('fonts', function () { |
21 | 21 | gulp.src('../src/styles/common/iconfont/fonts/*.*') |
22 | - .pipe(gulp.dest('../dist/styles/fonts')) | |
22 | + .pipe(gulp.dest('../dist/styles/fonts')); | |
23 | 23 | }); |
24 | 24 | |
25 | 25 | gulp.task('default', ['css', 'fonts']); | ... | ... |
package.json
... | ... | @@ -24,6 +24,8 @@ |
24 | 24 | "dist:dev": "webpack --config build/webpack.dist.dev.config.js", |
25 | 25 | "dist:prod": "webpack --config build/webpack.dist.prod.config.js", |
26 | 26 | "dist": "npm run dist:style && npm run dist:dev && npm run dist:prod", |
27 | + "lint": "eslint --fix --ext .js,.vue src", | |
28 | + "test": "npm run dist && npm run lint", | |
27 | 29 | "prepublish": "npm run dist" |
28 | 30 | }, |
29 | 31 | "repository": { |
... | ... | @@ -51,9 +53,8 @@ |
51 | 53 | "babel-preset-es2015": "^6.9.0", |
52 | 54 | "babel-runtime": "^6.11.6", |
53 | 55 | "css-loader": "^0.23.1", |
54 | - "eslint": "^2.5.3", | |
55 | - "eslint-friendly-formatter": "^2.0.6", | |
56 | - "eslint-loader": "^1.3.0", | |
56 | + "eslint": "^3.12.2", | |
57 | + "eslint-plugin-html": "^1.7.0", | |
57 | 58 | "extract-text-webpack-plugin": "^1.0.1", |
58 | 59 | "file-loader": "^0.8.5", |
59 | 60 | "gulp": "^3.9.1", | ... | ... |
src/components/affix/affix.vue
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 | return { |
36 | 36 | top: rect.top + scrollTop - clientTop, |
37 | 37 | left: rect.left + scrollLeft - clientLeft |
38 | - } | |
38 | + }; | |
39 | 39 | } |
40 | 40 | |
41 | 41 | export default { |
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | return { |
53 | 53 | affix: false, |
54 | 54 | styles: {} |
55 | - } | |
55 | + }; | |
56 | 56 | }, |
57 | 57 | computed: { |
58 | 58 | offsetType () { |
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 | { |
69 | 69 | [`${prefixCls}`]: this.affix |
70 | 70 | } |
71 | - ] | |
71 | + ]; | |
72 | 72 | } |
73 | 73 | }, |
74 | 74 | ready () { |
... | ... | @@ -117,10 +117,10 @@ |
117 | 117 | } else if ((elOffset.top + this.offsetBottom + elHeight) < (scrollTop + windowHeight) && this.offsetType == 'bottom' && affix) { |
118 | 118 | this.affix = false; |
119 | 119 | this.styles = null; |
120 | - | |
120 | + | |
121 | 121 | this.$emit('on-change', false); |
122 | 122 | } |
123 | 123 | } |
124 | 124 | } |
125 | - } | |
125 | + }; | |
126 | 126 | </script> | ... | ... |
src/components/alert/alert.vue
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | return { |
43 | 43 | closed: false, |
44 | 44 | desc: false |
45 | - } | |
45 | + }; | |
46 | 46 | }, |
47 | 47 | computed: { |
48 | 48 | wrapClasses () { |
... | ... | @@ -53,7 +53,7 @@ |
53 | 53 | [`${prefixCls}-with-icon`]: this.showIcon, |
54 | 54 | [`${prefixCls}-with-desc`]: this.desc |
55 | 55 | } |
56 | - ] | |
56 | + ]; | |
57 | 57 | }, |
58 | 58 | messageClasses () { |
59 | 59 | return `${prefixCls}-message`; |
... | ... | @@ -97,5 +97,5 @@ |
97 | 97 | compiled () { |
98 | 98 | this.desc = this.$els.desc.innerHTML != ''; |
99 | 99 | } |
100 | - } | |
101 | -</script> | |
102 | 100 | \ No newline at end of file |
101 | + }; | |
102 | +</script> | ... | ... |
src/components/back-top/back-top.vue
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | data () { |
29 | 29 | return { |
30 | 30 | backTop: false |
31 | - } | |
31 | + }; | |
32 | 32 | }, |
33 | 33 | ready () { |
34 | 34 | window.addEventListener('scroll', this.handleScroll, false); |
... | ... | @@ -45,13 +45,13 @@ |
45 | 45 | { |
46 | 46 | [`${prefixCls}-show`]: this.backTop |
47 | 47 | } |
48 | - ] | |
48 | + ]; | |
49 | 49 | }, |
50 | 50 | styles () { |
51 | 51 | return { |
52 | 52 | bottom: `${this.bottom}px`, |
53 | 53 | right: `${this.right}px` |
54 | - } | |
54 | + }; | |
55 | 55 | }, |
56 | 56 | innerClasses () { |
57 | 57 | return `${prefixCls}-inner`; |
... | ... | @@ -66,5 +66,5 @@ |
66 | 66 | this.$emit('on-click'); |
67 | 67 | } |
68 | 68 | } |
69 | - } | |
69 | + }; | |
70 | 70 | </script> | ... | ... |
src/components/badge/badge.vue
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | [`${this.class}`]: !!this.class, |
39 | 39 | [`${prefixCls}-count-alone`]: this.alone |
40 | 40 | } |
41 | - ] | |
41 | + ]; | |
42 | 42 | }, |
43 | 43 | finalCount () { |
44 | 44 | return parseInt(this.count) >= parseInt(this.overflowCount) ? `${this.overflowCount}+` : this.count; |
... | ... | @@ -65,7 +65,7 @@ |
65 | 65 | data () { |
66 | 66 | return { |
67 | 67 | alone: false |
68 | - } | |
68 | + }; | |
69 | 69 | }, |
70 | 70 | compiled () { |
71 | 71 | const child_length = this.$els.badge.children.length; |
... | ... | @@ -73,5 +73,5 @@ |
73 | 73 | this.alone = true; |
74 | 74 | } |
75 | 75 | } |
76 | - } | |
77 | -</script> | |
78 | 76 | \ No newline at end of file |
77 | + }; | |
78 | +</script> | ... | ... |
src/components/base/notification/index.js
src/components/base/notification/notice.vue
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | default: function() { |
27 | 27 | return { |
28 | 28 | right: '50%' |
29 | - } | |
29 | + }; | |
30 | 30 | } |
31 | 31 | }, |
32 | 32 | closable: { |
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | data () { |
51 | 51 | return { |
52 | 52 | withDesc: false |
53 | - } | |
53 | + }; | |
54 | 54 | }, |
55 | 55 | computed: { |
56 | 56 | baseClass () { |
... | ... | @@ -64,7 +64,7 @@ |
64 | 64 | [`${this.baseClass}-closable`]: this.closable, |
65 | 65 | [`${this.baseClass}-with-desc`]: this.withDesc |
66 | 66 | } |
67 | - ] | |
67 | + ]; | |
68 | 68 | }, |
69 | 69 | contentClasses () { |
70 | 70 | return `${this.baseClass}-content`; |
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 | if (this.duration !== 0) { |
90 | 90 | this.closeTimer = setTimeout(() => { |
91 | 91 | this.close(); |
92 | - }, this.duration * 1000) | |
92 | + }, this.duration * 1000); | |
93 | 93 | } |
94 | 94 | |
95 | 95 | // check if with desc in Notice component |
... | ... | @@ -100,5 +100,5 @@ |
100 | 100 | beforeDestroy () { |
101 | 101 | this.clearCloseTimer(); |
102 | 102 | } |
103 | - } | |
103 | + }; | |
104 | 104 | </script> | ... | ... |
src/components/base/notification/notification.vue
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | return { |
37 | 37 | top: '65px', |
38 | 38 | left: '50%' |
39 | - } | |
39 | + }; | |
40 | 40 | } |
41 | 41 | }, |
42 | 42 | content: { |
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | data () { |
50 | 50 | return { |
51 | 51 | notices: [] |
52 | - } | |
52 | + }; | |
53 | 53 | }, |
54 | 54 | computed: { |
55 | 55 | classes () { |
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 | { |
59 | 59 | [`${this.className}`]: !!this.className |
60 | 60 | } |
61 | - ] | |
61 | + ]; | |
62 | 62 | } |
63 | 63 | }, |
64 | 64 | methods: { |
... | ... | @@ -88,5 +88,5 @@ |
88 | 88 | } |
89 | 89 | } |
90 | 90 | } |
91 | - } | |
92 | -</script> | |
93 | 91 | \ No newline at end of file |
92 | + }; | |
93 | +</script> | ... | ... |
src/components/base/popper.js
... | ... | @@ -26,7 +26,7 @@ export default { |
26 | 26 | return { |
27 | 27 | gpuAcceleration: false, |
28 | 28 | boundariesElement: 'body' |
29 | - } | |
29 | + }; | |
30 | 30 | } |
31 | 31 | }, |
32 | 32 | visible: { |
... | ... | @@ -103,4 +103,4 @@ export default { |
103 | 103 | this.popperJS.destroy(); |
104 | 104 | } |
105 | 105 | } |
106 | -}; | |
107 | 106 | \ No newline at end of file |
107 | +}; | ... | ... |
src/components/breadcrumb/breadcrumb-item.vue
src/components/breadcrumb/breadcrumb.vue
src/components/button/button-group.vue
src/components/button/button.vue
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | data () { |
47 | 47 | return { |
48 | 48 | showSlot: true |
49 | - } | |
49 | + }; | |
50 | 50 | }, |
51 | 51 | computed: { |
52 | 52 | classes () { |
... | ... | @@ -60,11 +60,11 @@ |
60 | 60 | [`${prefixCls}-loading`]: this.loading != null && this.loading, |
61 | 61 | [`${prefixCls}-icon-only`]: !this.showSlot && (!!this.icon || this.loading) |
62 | 62 | } |
63 | - ] | |
63 | + ]; | |
64 | 64 | } |
65 | 65 | }, |
66 | 66 | compiled () { |
67 | 67 | this.showSlot = this.$els.slot.innerHTML.replace(/\n/g, '').replace(/<!--[\w\W\r\n]*?-->/gmi, '') !== ''; |
68 | 68 | } |
69 | - } | |
69 | + }; | |
70 | 70 | </script> | ... | ... |
src/components/card/card.vue
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | return { |
28 | 28 | showHead: true, |
29 | 29 | showExtra: true |
30 | - } | |
30 | + }; | |
31 | 31 | }, |
32 | 32 | computed: { |
33 | 33 | classes () { |
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | [`${prefixCls}-dis-hover`]: this.disHover || this.shadow, |
39 | 39 | [`${prefixCls}-shadow`]: this.shadow |
40 | 40 | } |
41 | - ] | |
41 | + ]; | |
42 | 42 | }, |
43 | 43 | headClasses () { |
44 | 44 | return `${prefixCls}-head`; |
... | ... | @@ -54,5 +54,5 @@ |
54 | 54 | this.showHead = this.$els.head.innerHTML != ''; |
55 | 55 | this.showExtra = this.$els.extra.innerHTML != ''; |
56 | 56 | } |
57 | - } | |
58 | -</script> | |
59 | 57 | \ No newline at end of file |
58 | + }; | |
59 | +</script> | ... | ... |
src/components/cascader/cascader.vue
... | ... | @@ -39,13 +39,13 @@ |
39 | 39 | data: { |
40 | 40 | type: Array, |
41 | 41 | default () { |
42 | - return [] | |
42 | + return []; | |
43 | 43 | } |
44 | 44 | }, |
45 | 45 | value: { |
46 | 46 | type: Array, |
47 | 47 | default () { |
48 | - return [] | |
48 | + return []; | |
49 | 49 | } |
50 | 50 | }, |
51 | 51 | disabled: { |
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 | visible: false, |
89 | 89 | selected: [], |
90 | 90 | tmpSelected: [] |
91 | - } | |
91 | + }; | |
92 | 92 | }, |
93 | 93 | computed: { |
94 | 94 | classes () { |
... | ... | @@ -99,7 +99,7 @@ |
99 | 99 | [`${prefixCls}-visible`]: this.visible, |
100 | 100 | [`${prefixCls}-disabled`]: this.disabled |
101 | 101 | } |
102 | - ] | |
102 | + ]; | |
103 | 103 | }, |
104 | 104 | showCloseIcon () { |
105 | 105 | return this.value && this.value.length && this.clearable; |
... | ... | @@ -182,5 +182,5 @@ |
182 | 182 | this.updateSelected(); |
183 | 183 | } |
184 | 184 | } |
185 | - } | |
186 | -</script> | |
187 | 185 | \ No newline at end of file |
186 | + }; | |
187 | +</script> | ... | ... |
src/components/cascader/casitem.vue
... | ... | @@ -16,8 +16,8 @@ |
16 | 16 | [`${this.prefixCls}-menu-item-active`]: this.tmpItem.value === this.data.value, |
17 | 17 | [`${this.prefixCls}-menu-item-disabled`]: this.data.disabled |
18 | 18 | } |
19 | - ] | |
19 | + ]; | |
20 | 20 | } |
21 | 21 | } |
22 | - } | |
23 | -</script> | |
24 | 22 | \ No newline at end of file |
23 | + }; | |
24 | +</script> | ... | ... |
src/components/cascader/caspanel.vue
... | ... | @@ -11,7 +11,6 @@ |
11 | 11 | </template> |
12 | 12 | <script> |
13 | 13 | import Casitem from './casitem.vue'; |
14 | - import { oneOf } from '../../utils/assist'; | |
15 | 14 | |
16 | 15 | export default { |
17 | 16 | name: 'Caspanel', |
... | ... | @@ -20,13 +19,13 @@ |
20 | 19 | data: { |
21 | 20 | type: Array, |
22 | 21 | default () { |
23 | - return [] | |
22 | + return []; | |
24 | 23 | } |
25 | 24 | }, |
26 | 25 | sublist: { |
27 | 26 | type: Array, |
28 | 27 | default () { |
29 | - return [] | |
28 | + return []; | |
30 | 29 | } |
31 | 30 | }, |
32 | 31 | disabled: Boolean, |
... | ... | @@ -38,7 +37,7 @@ |
38 | 37 | return { |
39 | 38 | tmpItem: {}, |
40 | 39 | result: [] |
41 | - } | |
40 | + }; | |
42 | 41 | }, |
43 | 42 | methods: { |
44 | 43 | handleClickItem (item) { |
... | ... | @@ -111,5 +110,5 @@ |
111 | 110 | this.tmpItem = {}; |
112 | 111 | } |
113 | 112 | } |
114 | - } | |
115 | -</script> | |
116 | 113 | \ No newline at end of file |
114 | + }; | |
115 | +</script> | ... | ... |
src/components/checkbox/checkbox-group.vue
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | model: { |
13 | 13 | type: Array, |
14 | 14 | default () { |
15 | - return [] | |
15 | + return []; | |
16 | 16 | } |
17 | 17 | } |
18 | 18 | }, |
... | ... | @@ -43,14 +43,9 @@ |
43 | 43 | } |
44 | 44 | }, |
45 | 45 | watch: { |
46 | - model (val, oldVal) { | |
47 | -// if (val == oldVal) { | |
48 | -// this.updateModel(); | |
49 | -// } else { | |
50 | -// this.updateModel(true); | |
51 | -// } | |
46 | + model () { | |
52 | 47 | this.updateModel(true); |
53 | 48 | } |
54 | 49 | } |
55 | - } | |
56 | -</script> | |
57 | 50 | \ No newline at end of file |
51 | + }; | |
52 | +</script> | ... | ... |
src/components/checkbox/checkbox.vue
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 | selected: false, |
45 | 45 | group: false, |
46 | 46 | showSlot: true |
47 | - } | |
47 | + }; | |
48 | 48 | }, |
49 | 49 | computed: { |
50 | 50 | wrapClasses () { |
... | ... | @@ -55,7 +55,7 @@ |
55 | 55 | [`${prefixCls}-wrapper-checked`]: this.selected, |
56 | 56 | [`${prefixCls}-wrapper-disabled`]: this.disabled |
57 | 57 | } |
58 | - ] | |
58 | + ]; | |
59 | 59 | }, |
60 | 60 | checkboxClasses () { |
61 | 61 | return [ |
... | ... | @@ -64,7 +64,7 @@ |
64 | 64 | [`${prefixCls}-checked`]: this.selected, |
65 | 65 | [`${prefixCls}-disabled`]: this.disabled |
66 | 66 | } |
67 | - ] | |
67 | + ]; | |
68 | 68 | }, |
69 | 69 | innerClasses () { |
70 | 70 | return `${prefixCls}-inner`; |
... | ... | @@ -105,5 +105,5 @@ |
105 | 105 | this.updateModel(); |
106 | 106 | } |
107 | 107 | } |
108 | - } | |
109 | -</script> | |
110 | 108 | \ No newline at end of file |
109 | + }; | |
110 | +</script> | ... | ... |
src/components/circle/circle.vue
... | ... | @@ -70,7 +70,7 @@ |
70 | 70 | 'stroke-dasharray': `${this.len}px ${this.len}px`, |
71 | 71 | 'stroke-dashoffset': `${((100 - this.percent) / 100 * this.len)}px`, |
72 | 72 | 'transition': 'stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease' |
73 | - } | |
73 | + }; | |
74 | 74 | }, |
75 | 75 | wrapClasses () { |
76 | 76 | return `${prefixCls}`; |
... | ... | @@ -79,5 +79,5 @@ |
79 | 79 | return `${prefixCls}-inner`; |
80 | 80 | } |
81 | 81 | } |
82 | - } | |
83 | -</script> | |
84 | 82 | \ No newline at end of file |
83 | + }; | |
84 | +</script> | ... | ... |
src/components/collapse/collapse.vue
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | |
41 | 41 | child.isActive = isActive; |
42 | 42 | child.index = index; |
43 | - }) | |
43 | + }); | |
44 | 44 | }, |
45 | 45 | getActiveKey () { |
46 | 46 | let activeKey = this.activeKey || []; |
... | ... | @@ -94,5 +94,5 @@ |
94 | 94 | this.setActive(); |
95 | 95 | } |
96 | 96 | } |
97 | - } | |
98 | -</script> | |
99 | 97 | \ No newline at end of file |
98 | + }; | |
99 | +</script> | ... | ... |
src/components/collapse/panel.vue
... | ... | @@ -24,7 +24,7 @@ |
24 | 24 | return { |
25 | 25 | index: 0, // use index for default when key is null |
26 | 26 | isActive: false |
27 | - } | |
27 | + }; | |
28 | 28 | }, |
29 | 29 | computed: { |
30 | 30 | itemClasses () { |
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | { |
34 | 34 | [`${prefixCls}-item-active`]: this.isActive |
35 | 35 | } |
36 | - ] | |
36 | + ]; | |
37 | 37 | }, |
38 | 38 | headerClasses () { |
39 | 39 | return `${prefixCls}-header`; |
... | ... | @@ -53,5 +53,5 @@ |
53 | 53 | }); |
54 | 54 | } |
55 | 55 | } |
56 | - } | |
57 | -</script> | |
58 | 56 | \ No newline at end of file |
57 | + }; | |
58 | +</script> | ... | ... |
src/components/date-picker/base/confirm.vue
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | data () { |
15 | 15 | return { |
16 | 16 | prefixCls: prefixCls |
17 | - } | |
17 | + }; | |
18 | 18 | }, |
19 | 19 | methods: { |
20 | 20 | handleClear () { |
... | ... | @@ -24,5 +24,5 @@ |
24 | 24 | this.$emit('on-pick-success'); |
25 | 25 | } |
26 | 26 | } |
27 | - } | |
28 | -</script> | |
29 | 27 | \ No newline at end of file |
28 | + }; | |
29 | +</script> | ... | ... |
src/components/date-picker/base/date-table.vue
... | ... | @@ -10,7 +10,7 @@ |
10 | 10 | </div> |
11 | 11 | </template> |
12 | 12 | <script> |
13 | - import { getFirstDayOfMonth, getDayCountOfMonth, getStartDateOfMonth } from '../util'; | |
13 | + import { getFirstDayOfMonth, getDayCountOfMonth } from '../util'; | |
14 | 14 | import { deepCopy } from '../../../utils/assist'; |
15 | 15 | |
16 | 16 | const prefixCls = 'ivu-date-picker-cells'; |
... | ... | @@ -46,7 +46,7 @@ |
46 | 46 | return { |
47 | 47 | prefixCls: prefixCls, |
48 | 48 | readCells: [] |
49 | - } | |
49 | + }; | |
50 | 50 | }, |
51 | 51 | watch: { |
52 | 52 | 'rangeState.endDate' (newVal) { |
... | ... | @@ -84,7 +84,7 @@ |
84 | 84 | classes () { |
85 | 85 | return [ |
86 | 86 | `${prefixCls}` |
87 | - ] | |
87 | + ]; | |
88 | 88 | }, |
89 | 89 | cells () { |
90 | 90 | const date = new Date(this.year, this.month, 1); |
... | ... | @@ -269,9 +269,9 @@ |
269 | 269 | [`${prefixCls}-cell-next-month`]: cell.type === 'next-month', |
270 | 270 | [`${prefixCls}-cell-range`]: cell.range && !cell.start && !cell.end |
271 | 271 | } |
272 | - ] | |
272 | + ]; | |
273 | 273 | }, |
274 | 274 | |
275 | 275 | } |
276 | - } | |
277 | -</script> | |
278 | 276 | \ No newline at end of file |
277 | + }; | |
278 | +</script> | ... | ... |
src/components/date-picker/base/month-table.vue
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | return [ |
24 | 24 | `${prefixCls}`, |
25 | 25 | `${prefixCls}-month` |
26 | - ] | |
26 | + ]; | |
27 | 27 | }, |
28 | 28 | cells () { |
29 | 29 | let cells = []; |
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | [`${prefixCls}-cell-selected`]: cell.selected, |
57 | 57 | [`${prefixCls}-cell-disabled`]: cell.disabled |
58 | 58 | } |
59 | - ] | |
59 | + ]; | |
60 | 60 | }, |
61 | 61 | handleClick (event) { |
62 | 62 | const target = event.target; |
... | ... | @@ -70,5 +70,5 @@ |
70 | 70 | this.$emit('on-pick-click'); |
71 | 71 | } |
72 | 72 | } |
73 | - } | |
74 | -</script> | |
75 | 73 | \ No newline at end of file |
74 | + }; | |
75 | +</script> | ... | ... |
src/components/date-picker/base/year-table.vue
... | ... | @@ -21,7 +21,7 @@ |
21 | 21 | return [ |
22 | 22 | `${prefixCls}`, |
23 | 23 | `${prefixCls}-year` |
24 | - ] | |
24 | + ]; | |
25 | 25 | }, |
26 | 26 | startYear() { |
27 | 27 | return Math.floor(this.year / 10) * 10; |
... | ... | @@ -57,7 +57,7 @@ |
57 | 57 | [`${prefixCls}-cell-selected`]: cell.selected, |
58 | 58 | [`${prefixCls}-cell-disabled`]: cell.disabled |
59 | 59 | } |
60 | - ] | |
60 | + ]; | |
61 | 61 | }, |
62 | 62 | nextTenYear() { |
63 | 63 | this.$emit('on-pick', Number(this.year) + 10, false); |
... | ... | @@ -76,5 +76,5 @@ |
76 | 76 | this.$emit('on-pick-click'); |
77 | 77 | } |
78 | 78 | } |
79 | - } | |
80 | -</script> | |
81 | 79 | \ No newline at end of file |
80 | + }; | |
81 | +</script> | ... | ... |
src/components/date-picker/panel/date-range.vue
... | ... | @@ -157,7 +157,7 @@ |
157 | 157 | selectionMode: 'range', |
158 | 158 | leftTableYear: null, |
159 | 159 | rightTableYear: null |
160 | - } | |
160 | + }; | |
161 | 161 | }, |
162 | 162 | computed: { |
163 | 163 | classes () { |
... | ... | @@ -167,7 +167,7 @@ |
167 | 167 | { |
168 | 168 | [`${prefixCls}-with-sidebar`]: this.shortcuts.length |
169 | 169 | } |
170 | - ] | |
170 | + ]; | |
171 | 171 | }, |
172 | 172 | leftYear () { |
173 | 173 | return this.date.getFullYear(); |
... | ... | @@ -353,5 +353,5 @@ |
353 | 353 | this.rangeState = val.rangeState; |
354 | 354 | } |
355 | 355 | } |
356 | - } | |
357 | -</script> | |
358 | 356 | \ No newline at end of file |
357 | + }; | |
358 | +</script> | ... | ... |
src/components/date-picker/panel/date.vue
... | ... | @@ -73,7 +73,6 @@ |
73 | 73 | import YearTable from '../base/year-table.vue'; |
74 | 74 | import MonthTable from '../base/month-table.vue'; |
75 | 75 | import Confirm from '../base/confirm.vue'; |
76 | - import { formatDate, parseDate } from '../util'; | |
77 | 76 | |
78 | 77 | import Mixin from './mixin'; |
79 | 78 | |
... | ... | @@ -97,7 +96,7 @@ |
97 | 96 | year: null, |
98 | 97 | month: null, |
99 | 98 | confirm: false |
100 | - } | |
99 | + }; | |
101 | 100 | }, |
102 | 101 | computed: { |
103 | 102 | classes () { |
... | ... | @@ -106,7 +105,7 @@ |
106 | 105 | { |
107 | 106 | [`${prefixCls}-with-sidebar`]: this.shortcuts.length |
108 | 107 | } |
109 | - ] | |
108 | + ]; | |
110 | 109 | }, |
111 | 110 | yearLabel () { |
112 | 111 | const year = this.year; |
... | ... | @@ -238,5 +237,5 @@ |
238 | 237 | this.month = this.date.getMonth(); |
239 | 238 | } |
240 | 239 | } |
241 | - } | |
242 | -</script> | |
243 | 240 | \ No newline at end of file |
241 | + }; | |
242 | +</script> | ... | ... |
src/components/date-picker/panel/mixin.js
... | ... | @@ -8,7 +8,7 @@ export default { |
8 | 8 | `${prefixCls}-icon-btn`, |
9 | 9 | `${datePrefixCls}-${direction}-btn`, |
10 | 10 | `${datePrefixCls}-${direction}-btn-arrow${type}`, |
11 | - ] | |
11 | + ]; | |
12 | 12 | }, |
13 | 13 | handleShortcutClick (shortcut) { |
14 | 14 | if (shortcut.value) this.$emit('on-pick', shortcut.value()); |
... | ... | @@ -24,4 +24,4 @@ export default { |
24 | 24 | this.$emit('on-pick-click'); |
25 | 25 | } |
26 | 26 | } |
27 | -} | |
28 | 27 | \ No newline at end of file |
28 | +}; | ... | ... |
src/components/date-picker/picker.vue
... | ... | @@ -193,7 +193,7 @@ |
193 | 193 | picker: null, |
194 | 194 | internalValue: '', |
195 | 195 | disableClickOutSide: false // fixed when click a date,trigger clickoutside to close picker |
196 | - } | |
196 | + }; | |
197 | 197 | }, |
198 | 198 | computed: { |
199 | 199 | opened () { |
... | ... | @@ -424,5 +424,5 @@ |
424 | 424 | ready () { |
425 | 425 | if (this.open !== null) this.visible = this.open; |
426 | 426 | } |
427 | - } | |
428 | -</script> | |
429 | 427 | \ No newline at end of file |
428 | + }; | |
429 | +</script> | ... | ... |
src/components/date-picker/picker/date-picker.js
src/components/dropdown/dropdown-item.vue
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | [`${prefixCls}-selected`]: this.selected, |
32 | 32 | [`${prefixCls}-divided`]: this.divided |
33 | 33 | } |
34 | - ] | |
34 | + ]; | |
35 | 35 | } |
36 | 36 | }, |
37 | 37 | methods: { |
... | ... | @@ -53,5 +53,5 @@ |
53 | 53 | $parent.$emit('on-click', this.key); |
54 | 54 | } |
55 | 55 | } |
56 | - } | |
57 | -</script> | |
58 | 56 | \ No newline at end of file |
57 | + }; | |
58 | +</script> | ... | ... |
src/components/dropdown/dropdown-menu.vue
src/components/dropdown/dropdown.vue
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | return { |
43 | 43 | prefixCls: prefixCls, |
44 | 44 | visible: false |
45 | - } | |
45 | + }; | |
46 | 46 | }, |
47 | 47 | methods: { |
48 | 48 | handleClick () { |
... | ... | @@ -120,5 +120,5 @@ |
120 | 120 | if ($parent) $parent.$emit('on-haschild-click'); |
121 | 121 | } |
122 | 122 | } |
123 | - } | |
124 | -</script> | |
125 | 123 | \ No newline at end of file |
124 | + }; | |
125 | +</script> | ... | ... |
src/components/icon/icon.vue
... | ... | @@ -12,21 +12,21 @@ |
12 | 12 | }, |
13 | 13 | computed: { |
14 | 14 | classes () { |
15 | - return `${prefixCls} ${prefixCls}-${this.type}` | |
15 | + return `${prefixCls} ${prefixCls}-${this.type}`; | |
16 | 16 | }, |
17 | 17 | styles () { |
18 | 18 | let style = {}; |
19 | 19 | |
20 | - if (!!this.size) { | |
20 | + if (this.size) { | |
21 | 21 | style['font-size'] = `${this.size}px`; |
22 | 22 | } |
23 | 23 | |
24 | - if (!!this.color) { | |
24 | + if (this.color) { | |
25 | 25 | style.color = this.color; |
26 | 26 | } |
27 | 27 | |
28 | 28 | return style; |
29 | 29 | } |
30 | 30 | } |
31 | - } | |
32 | -</script> | |
33 | 31 | \ No newline at end of file |
32 | + }; | |
33 | +</script> | ... | ... |
src/components/input-number/input-number.vue
... | ... | @@ -39,13 +39,13 @@ |
39 | 39 | function addNum (num1, num2) { |
40 | 40 | let sq1, sq2, m; |
41 | 41 | try { |
42 | - sq1 = num1.toString().split(".")[1].length; | |
42 | + sq1 = num1.toString().split('.')[1].length; | |
43 | 43 | } |
44 | 44 | catch (e) { |
45 | 45 | sq1 = 0; |
46 | 46 | } |
47 | 47 | try { |
48 | - sq2 = num2.toString().split(".")[1].length; | |
48 | + sq2 = num2.toString().split('.')[1].length; | |
49 | 49 | } |
50 | 50 | catch (e) { |
51 | 51 | sq2 = 0; |
... | ... | @@ -93,7 +93,7 @@ |
93 | 93 | focused: false, |
94 | 94 | upDisabled: false, |
95 | 95 | downDisabled: false |
96 | - } | |
96 | + }; | |
97 | 97 | }, |
98 | 98 | computed: { |
99 | 99 | wrapClasses () { |
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | [`${prefixCls}-disabled`]: this.disabled, |
105 | 105 | [`${prefixCls}-focused`]: this.focused |
106 | 106 | } |
107 | - ] | |
107 | + ]; | |
108 | 108 | }, |
109 | 109 | handlerClasses () { |
110 | 110 | return `${prefixCls}-handler-wrap`; |
... | ... | @@ -116,7 +116,7 @@ |
116 | 116 | { |
117 | 117 | [`${prefixCls}-handler-up-disabled`]: this.upDisabled |
118 | 118 | } |
119 | - ] | |
119 | + ]; | |
120 | 120 | }, |
121 | 121 | innerUpClasses () { |
122 | 122 | return `${prefixCls}-handler-up-inner ${iconPrefixCls} ${iconPrefixCls}-ios-arrow-up`; |
... | ... | @@ -128,7 +128,7 @@ |
128 | 128 | { |
129 | 129 | [`${prefixCls}-handler-down-disabled`]: this.downDisabled |
130 | 130 | } |
131 | - ] | |
131 | + ]; | |
132 | 132 | }, |
133 | 133 | innerDownClasses () { |
134 | 134 | return `${prefixCls}-handler-down-inner ${iconPrefixCls} ${iconPrefixCls}-ios-arrow-down`; |
... | ... | @@ -190,10 +190,10 @@ |
190 | 190 | keyDown (e) { |
191 | 191 | if (e.keyCode === 38) { |
192 | 192 | e.preventDefault(); |
193 | - this.up() | |
193 | + this.up(); | |
194 | 194 | } else if (e.keyCode === 40) { |
195 | 195 | e.preventDefault(); |
196 | - this.down() | |
196 | + this.down(); | |
197 | 197 | } |
198 | 198 | }, |
199 | 199 | change (event) { |
... | ... | @@ -238,5 +238,5 @@ |
238 | 238 | this.changeVal(val); |
239 | 239 | } |
240 | 240 | } |
241 | - } | |
241 | + }; | |
242 | 242 | </script> | ... | ... |
src/components/input/input.vue
... | ... | @@ -96,7 +96,7 @@ |
96 | 96 | append: true, |
97 | 97 | slotReady: false, |
98 | 98 | textareaStyles: {} |
99 | - } | |
99 | + }; | |
100 | 100 | }, |
101 | 101 | computed: { |
102 | 102 | wrapClasses () { |
... | ... | @@ -108,7 +108,7 @@ |
108 | 108 | [`${prefixCls}-group`]: this.prepend || this.append, |
109 | 109 | [`${prefixCls}-group-${this.size}`]: (this.prepend || this.append) && !!this.size |
110 | 110 | } |
111 | - ] | |
111 | + ]; | |
112 | 112 | }, |
113 | 113 | inputClasses () { |
114 | 114 | return [ |
... | ... | @@ -117,7 +117,7 @@ |
117 | 117 | [`${prefixCls}-${this.size}`]: !!this.size, |
118 | 118 | [`${prefixCls}-disabled`]: this.disabled |
119 | 119 | } |
120 | - ] | |
120 | + ]; | |
121 | 121 | }, |
122 | 122 | textareaClasses () { |
123 | 123 | return [ |
... | ... | @@ -125,7 +125,7 @@ |
125 | 125 | { |
126 | 126 | [`${prefixCls}-disabled`]: this.disabled |
127 | 127 | } |
128 | - ] | |
128 | + ]; | |
129 | 129 | } |
130 | 130 | }, |
131 | 131 | methods: { |
... | ... | @@ -174,5 +174,5 @@ |
174 | 174 | this.slotReady = true; |
175 | 175 | this.resizeTextarea(); |
176 | 176 | } |
177 | - } | |
178 | -</script> | |
179 | 177 | \ No newline at end of file |
178 | + }; | |
179 | +</script> | ... | ... |
src/components/layout/col.vue
... | ... | @@ -4,8 +4,6 @@ |
4 | 4 | </div> |
5 | 5 | </template> |
6 | 6 | <script> |
7 | - import { oneOf } from '../../utils/assist'; | |
8 | - | |
9 | 7 | const prefixCls = 'ivu-col'; |
10 | 8 | |
11 | 9 | export default { |
... | ... | @@ -24,7 +22,7 @@ |
24 | 22 | data () { |
25 | 23 | return { |
26 | 24 | gutter: 0 |
27 | - } | |
25 | + }; | |
28 | 26 | }, |
29 | 27 | computed: { |
30 | 28 | classes () { |
... | ... | @@ -63,11 +61,11 @@ |
63 | 61 | style = { |
64 | 62 | paddingLeft: this.gutter / 2 + 'px', |
65 | 63 | paddingRight: this.gutter / 2 + 'px' |
66 | - } | |
64 | + }; | |
67 | 65 | } |
68 | 66 | |
69 | 67 | return style; |
70 | 68 | } |
71 | 69 | } |
72 | - } | |
73 | -</script> | |
74 | 70 | \ No newline at end of file |
71 | + }; | |
72 | +</script> | ... | ... |
src/components/layout/row.vue
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | [`${prefixCls}-${this.type}-${this.justify}`]: !!this.justify, |
42 | 42 | [`${this.className}`]: !!this.className |
43 | 43 | } |
44 | - ] | |
44 | + ]; | |
45 | 45 | }, |
46 | 46 | styles () { |
47 | 47 | let style = {}; |
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | style = { |
50 | 50 | marginLeft: this.gutter / -2 + 'px', |
51 | 51 | marginRight: this.gutter / -2 + 'px' |
52 | - } | |
52 | + }; | |
53 | 53 | } |
54 | 54 | |
55 | 55 | return style; |
... | ... | @@ -72,5 +72,5 @@ |
72 | 72 | ready () { |
73 | 73 | this.updateGutter(this.gutter); |
74 | 74 | } |
75 | - } | |
76 | -</script> | |
77 | 75 | \ No newline at end of file |
76 | + }; | |
77 | +</script> | ... | ... |
src/components/loading-bar/index.js
... | ... | @@ -31,7 +31,7 @@ function hide() { |
31 | 31 | update({ |
32 | 32 | percent: 0 |
33 | 33 | }); |
34 | - }, 200) | |
34 | + }, 200); | |
35 | 35 | }, 800); |
36 | 36 | } |
37 | 37 | |
... | ... | @@ -109,4 +109,4 @@ export default { |
109 | 109 | loadingBarInstance = null; |
110 | 110 | instance.destroy(); |
111 | 111 | } |
112 | -} | |
113 | 112 | \ No newline at end of file |
113 | +}; | ... | ... |
src/components/loading-bar/loading-bar.js
src/components/loading-bar/loading-bar.vue
... | ... | @@ -49,12 +49,12 @@ |
49 | 49 | [`${prefixCls}-inner-color-primary`]: this.color === 'primary' && this.status === 'success', |
50 | 50 | [`${prefixCls}-inner-failed-color-error`]: this.failedColor === 'error' && this.status === 'error' |
51 | 51 | } |
52 | - ] | |
52 | + ]; | |
53 | 53 | }, |
54 | 54 | outerStyles () { |
55 | 55 | return { |
56 | 56 | height: `${this.height}px` |
57 | - } | |
57 | + }; | |
58 | 58 | }, |
59 | 59 | styles () { |
60 | 60 | let style = { |
... | ... | @@ -73,5 +73,5 @@ |
73 | 73 | return style; |
74 | 74 | } |
75 | 75 | } |
76 | - } | |
77 | -</script> | |
78 | 76 | \ No newline at end of file |
77 | + }; | |
78 | +</script> | ... | ... |
src/components/menu/menu-group.vue
src/components/menu/menu-item.vue
... | ... | @@ -19,7 +19,7 @@ |
19 | 19 | data () { |
20 | 20 | return { |
21 | 21 | active: false |
22 | - } | |
22 | + }; | |
23 | 23 | }, |
24 | 24 | computed: { |
25 | 25 | classes () { |
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | [`${prefixCls}-item-selected`]: this.active, |
31 | 31 | [`${prefixCls}-item-disabled`]: this.disabled |
32 | 32 | } |
33 | - ] | |
33 | + ]; | |
34 | 34 | } |
35 | 35 | }, |
36 | 36 | methods: { |
... | ... | @@ -39,5 +39,5 @@ |
39 | 39 | this.$dispatch('on-menu-item-select', this.key); |
40 | 40 | } |
41 | 41 | } |
42 | - } | |
43 | -</script> | |
44 | 42 | \ No newline at end of file |
43 | + }; | |
44 | +</script> | ... | ... |
src/components/menu/menu.vue
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | openKeys: { |
27 | 27 | type: Array, |
28 | 28 | default () { |
29 | - return [] | |
29 | + return []; | |
30 | 30 | } |
31 | 31 | }, |
32 | 32 | accordion: { |
... | ... | @@ -49,7 +49,7 @@ |
49 | 49 | { |
50 | 50 | [`${prefixCls}-${this.mode}`]: this.mode |
51 | 51 | } |
52 | - ] | |
52 | + ]; | |
53 | 53 | }, |
54 | 54 | styles () { |
55 | 55 | let style = {}; |
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | } else { |
78 | 78 | groupItem.active = false; |
79 | 79 | } |
80 | - }) | |
80 | + }); | |
81 | 81 | } else if (subitem.$options.name === 'MenuItem') { |
82 | 82 | if (subitem.key === this.activeKey) { |
83 | 83 | subitem.active = true; |
... | ... | @@ -86,15 +86,15 @@ |
86 | 86 | subitem.active = false; |
87 | 87 | } |
88 | 88 | } |
89 | - }) | |
89 | + }); | |
90 | 90 | } else if (item.$options.name === 'MenuGroup') { |
91 | 91 | item.$children.forEach(groupItem => { |
92 | 92 | groupItem.active = groupItem.key === this.activeKey; |
93 | - }) | |
93 | + }); | |
94 | 94 | } else if (item.$options.name === 'MenuItem') { |
95 | 95 | item.active = item.key === this.activeKey; |
96 | 96 | } |
97 | - }) | |
97 | + }); | |
98 | 98 | }, |
99 | 99 | updateOpenKeys (key) { |
100 | 100 | const index = this.openKeys.indexOf(key); |
... | ... | @@ -109,7 +109,7 @@ |
109 | 109 | if (item.$options.name === 'Submenu') { |
110 | 110 | if (this.openKeys.indexOf(item.key) > -1) item.opened = true; |
111 | 111 | } |
112 | - }) | |
112 | + }); | |
113 | 113 | } |
114 | 114 | }, |
115 | 115 | compiled () { |
... | ... | @@ -128,5 +128,5 @@ |
128 | 128 | this.$emit('on-open-change', this.openKeys); |
129 | 129 | } |
130 | 130 | } |
131 | - } | |
132 | -</script> | |
133 | 131 | \ No newline at end of file |
132 | + }; | |
133 | +</script> | ... | ... |
src/components/menu/submenu.vue
... | ... | @@ -31,7 +31,7 @@ |
31 | 31 | prefixCls: prefixCls, |
32 | 32 | active: false, |
33 | 33 | opened: false |
34 | - } | |
34 | + }; | |
35 | 35 | }, |
36 | 36 | computed: { |
37 | 37 | classes () { |
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | [`${prefixCls}-opened`]: this.opened, |
43 | 43 | [`${prefixCls}-submenu-disabled`]: this.disabled |
44 | 44 | } |
45 | - ] | |
45 | + ]; | |
46 | 46 | }, |
47 | 47 | mode () { |
48 | 48 | return this.$parent.mode; |
... | ... | @@ -106,5 +106,5 @@ |
106 | 106 | return true; |
107 | 107 | } |
108 | 108 | } |
109 | - } | |
110 | -</script> | |
111 | 109 | \ No newline at end of file |
110 | + }; | |
111 | +</script> | ... | ... |
src/components/message/index.js
... | ... | @@ -32,7 +32,7 @@ function notice (content, duration = defaultDuration, type, onClose) { |
32 | 32 | if (!onClose) { |
33 | 33 | onClose = function () { |
34 | 34 | |
35 | - } | |
35 | + }; | |
36 | 36 | } |
37 | 37 | const iconType = iconTypes[type]; |
38 | 38 | |
... | ... | @@ -61,7 +61,7 @@ function notice (content, duration = defaultDuration, type, onClose) { |
61 | 61 | |
62 | 62 | return function () { |
63 | 63 | instance.remove(`${prefixKey}${target}`); |
64 | - } | |
64 | + }; | |
65 | 65 | })(); |
66 | 66 | } |
67 | 67 | |
... | ... | @@ -94,4 +94,4 @@ export default { |
94 | 94 | messageInstance = null; |
95 | 95 | instance.destroy(); |
96 | 96 | } |
97 | -} | |
98 | 97 | \ No newline at end of file |
98 | +}; | |
99 | 99 | \ No newline at end of file | ... | ... |
src/components/modal/confirm.js
... | ... | @@ -55,13 +55,13 @@ Modal.newInstance = properties => { |
55 | 55 | return [ |
56 | 56 | `${prefixCls}-body-icon`, |
57 | 57 | `${prefixCls}-body-icon-${this.iconType}` |
58 | - ] | |
58 | + ]; | |
59 | 59 | }, |
60 | 60 | iconNameCls () { |
61 | 61 | return [ |
62 | 62 | 'ivu-icon', |
63 | 63 | `ivu-icon-${this.iconName}` |
64 | - ] | |
64 | + ]; | |
65 | 65 | } |
66 | 66 | }, |
67 | 67 | methods: { |
... | ... | @@ -163,7 +163,7 @@ Modal.newInstance = properties => { |
163 | 163 | modal.$parent.remove(); |
164 | 164 | }, |
165 | 165 | component: modal |
166 | - } | |
166 | + }; | |
167 | 167 | }; |
168 | 168 | |
169 | 169 | export default Modal; |
170 | 170 | \ No newline at end of file | ... | ... |
src/components/modal/modal.vue
... | ... | @@ -79,7 +79,7 @@ |
79 | 79 | wrapShow: false, |
80 | 80 | showHead: true, |
81 | 81 | buttonLoading: false |
82 | - } | |
82 | + }; | |
83 | 83 | }, |
84 | 84 | computed: { |
85 | 85 | wrapClasses () { |
... | ... | @@ -89,7 +89,7 @@ |
89 | 89 | [`${prefixCls}-hidden`]: !this.wrapShow, |
90 | 90 | [`${this.className}`]: !!this.className |
91 | 91 | } |
92 | - ] | |
92 | + ]; | |
93 | 93 | }, |
94 | 94 | maskClasses () { |
95 | 95 | return `${prefixCls}-mask`; |
... | ... | @@ -104,7 +104,7 @@ |
104 | 104 | width: `${this.width}px` |
105 | 105 | }; |
106 | 106 | |
107 | - const customStyle = !!this.style ? this.style : {}; | |
107 | + const customStyle = this.style ? this.style : {}; | |
108 | 108 | |
109 | 109 | Object.assign(style, styleWidth, customStyle); |
110 | 110 | |
... | ... | @@ -135,7 +135,7 @@ |
135 | 135 | EscClose (e) { |
136 | 136 | if (this.visible && this.closable) { |
137 | 137 | if (e.keyCode === 27) { |
138 | - this.close() | |
138 | + this.close(); | |
139 | 139 | } |
140 | 140 | } |
141 | 141 | }, |
... | ... | @@ -207,5 +207,5 @@ |
207 | 207 | } |
208 | 208 | } |
209 | 209 | } |
210 | - } | |
210 | + }; | |
211 | 211 | </script> | ... | ... |
src/components/notice/index.js
src/components/page/options.vue
... | ... | @@ -41,17 +41,17 @@ |
41 | 41 | optsClasses () { |
42 | 42 | return [ |
43 | 43 | `${prefixCls}-options` |
44 | - ] | |
44 | + ]; | |
45 | 45 | }, |
46 | 46 | sizerClasses () { |
47 | 47 | return [ |
48 | 48 | `${prefixCls}-options-sizer` |
49 | - ] | |
49 | + ]; | |
50 | 50 | }, |
51 | 51 | ElevatorClasses () { |
52 | 52 | return [ |
53 | 53 | `${prefixCls}-options-elevator` |
54 | - ] | |
54 | + ]; | |
55 | 55 | } |
56 | 56 | }, |
57 | 57 | methods: { |
... | ... | @@ -83,5 +83,5 @@ |
83 | 83 | } |
84 | 84 | } |
85 | 85 | } |
86 | - } | |
87 | -</script> | |
88 | 86 | \ No newline at end of file |
87 | + }; | |
88 | +</script> | ... | ... |
src/components/page/page.vue
... | ... | @@ -86,7 +86,7 @@ |
86 | 86 | pageSizeOpts: { |
87 | 87 | type: Array, |
88 | 88 | default () { |
89 | - return [10, 20, 30, 40] | |
89 | + return [10, 20, 30, 40]; | |
90 | 90 | } |
91 | 91 | }, |
92 | 92 | size: { |
... | ... | @@ -120,7 +120,7 @@ |
120 | 120 | data () { |
121 | 121 | return { |
122 | 122 | prefixCls: prefixCls |
123 | - } | |
123 | + }; | |
124 | 124 | }, |
125 | 125 | computed: { |
126 | 126 | isSmall () { |
... | ... | @@ -137,7 +137,7 @@ |
137 | 137 | { |
138 | 138 | [`${this.class}`]: !!this.class |
139 | 139 | } |
140 | - ] | |
140 | + ]; | |
141 | 141 | }, |
142 | 142 | simplePagerClasses () { |
143 | 143 | return `${prefixCls}-simple-pager`; |
... | ... | @@ -149,7 +149,7 @@ |
149 | 149 | [`${this.class}`]: !!this.class, |
150 | 150 | 'mini': !!this.size |
151 | 151 | } |
152 | - ] | |
152 | + ]; | |
153 | 153 | }, |
154 | 154 | prevClasses () { |
155 | 155 | return [ |
... | ... | @@ -157,7 +157,7 @@ |
157 | 157 | { |
158 | 158 | [`${prefixCls}-disabled`]: this.current === 1 |
159 | 159 | } |
160 | - ] | |
160 | + ]; | |
161 | 161 | }, |
162 | 162 | nextClasses () { |
163 | 163 | return [ |
... | ... | @@ -165,7 +165,7 @@ |
165 | 165 | { |
166 | 166 | [`${prefixCls}-disabled`]: this.current === this.allPages |
167 | 167 | } |
168 | - ] | |
168 | + ]; | |
169 | 169 | }, |
170 | 170 | firstPageClasses () { |
171 | 171 | return [ |
... | ... | @@ -173,7 +173,7 @@ |
173 | 173 | { |
174 | 174 | [`${prefixCls}-item-active`]: this.current === 1 |
175 | 175 | } |
176 | - ] | |
176 | + ]; | |
177 | 177 | }, |
178 | 178 | lastPageClasses () { |
179 | 179 | return [ |
... | ... | @@ -181,7 +181,7 @@ |
181 | 181 | { |
182 | 182 | [`${prefixCls}-item-active`]: this.current === this.allPages |
183 | 183 | } |
184 | - ] | |
184 | + ]; | |
185 | 185 | } |
186 | 186 | }, |
187 | 187 | methods: { |
... | ... | @@ -242,9 +242,9 @@ |
242 | 242 | const val = parseInt(e.target.value); |
243 | 243 | |
244 | 244 | if (key === 38) { |
245 | - this.prev() | |
245 | + this.prev(); | |
246 | 246 | } else if (key === 40) { |
247 | - this.next() | |
247 | + this.next(); | |
248 | 248 | } else if (key == 13) { |
249 | 249 | let page = 1; |
250 | 250 | |
... | ... | @@ -261,5 +261,5 @@ |
261 | 261 | } |
262 | 262 | } |
263 | 263 | } |
264 | - } | |
264 | + }; | |
265 | 265 | </script> | ... | ... |
src/components/poptip/poptip.vue
... | ... | @@ -87,7 +87,7 @@ |
87 | 87 | return { |
88 | 88 | prefixCls: prefixCls, |
89 | 89 | showTitle: true |
90 | - } | |
90 | + }; | |
91 | 91 | }, |
92 | 92 | computed: { |
93 | 93 | classes () { |
... | ... | @@ -96,12 +96,12 @@ |
96 | 96 | { |
97 | 97 | [`${prefixCls}-confirm`]: this.confirm |
98 | 98 | } |
99 | - ] | |
99 | + ]; | |
100 | 100 | }, |
101 | 101 | styles () { |
102 | 102 | let style = {}; |
103 | 103 | |
104 | - if (!!this.width) { | |
104 | + if (this.width) { | |
105 | 105 | style.width = `${this.width}px`; |
106 | 106 | } |
107 | 107 | return style; |
... | ... | @@ -166,5 +166,5 @@ |
166 | 166 | this.showTitle = this.$els.title.innerHTML != `<div class="${prefixCls}-title-inner"></div>`; |
167 | 167 | } |
168 | 168 | } |
169 | - } | |
169 | + }; | |
170 | 170 | </script> | ... | ... |
src/components/progress/progress.vue
... | ... | @@ -56,7 +56,7 @@ |
56 | 56 | type = 'ios-close'; |
57 | 57 | break; |
58 | 58 | case 'success': |
59 | - type = 'ios-checkmark'; | |
59 | + type = 'ios-checkmark'; | |
60 | 60 | break; |
61 | 61 | } |
62 | 62 | |
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 | return { |
67 | 67 | width: `${this.percent}%`, |
68 | 68 | height: `${this.strokeWidth}px` |
69 | - } | |
69 | + }; | |
70 | 70 | }, |
71 | 71 | wrapClasses () { |
72 | 72 | return [ |
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 | [`${prefixCls}-show-info`]: !this.hideInfo, |
77 | 77 | |
78 | 78 | } |
79 | - ] | |
79 | + ]; | |
80 | 80 | }, |
81 | 81 | textClasses () { |
82 | 82 | return `${prefixCls}-text`; |
... | ... | @@ -117,5 +117,5 @@ |
117 | 117 | } |
118 | 118 | } |
119 | 119 | } |
120 | - } | |
121 | -</script> | |
122 | 120 | \ No newline at end of file |
121 | + }; | |
122 | +</script> | ... | ... |
src/components/radio/radio-group.vue
... | ... | @@ -33,7 +33,7 @@ |
33 | 33 | [`${prefixCls}-${this.size}`]: !!this.size, |
34 | 34 | [`${prefixCls}-${this.type}`]: !!this.type |
35 | 35 | } |
36 | - ] | |
36 | + ]; | |
37 | 37 | } |
38 | 38 | }, |
39 | 39 | compiled () { |
... | ... | @@ -55,8 +55,8 @@ |
55 | 55 | }, |
56 | 56 | watch: { |
57 | 57 | model () { |
58 | - this.updateModel() | |
58 | + this.updateModel(); | |
59 | 59 | } |
60 | 60 | } |
61 | - } | |
62 | -</script> | |
63 | 61 | \ No newline at end of file |
62 | + }; | |
63 | +</script> | ... | ... |
src/components/radio/radio.vue
... | ... | @@ -32,7 +32,7 @@ |
32 | 32 | return { |
33 | 33 | selected: false, |
34 | 34 | group: false |
35 | - } | |
35 | + }; | |
36 | 36 | }, |
37 | 37 | computed: { |
38 | 38 | wrapClasses () { |
... | ... | @@ -43,7 +43,7 @@ |
43 | 43 | [`${prefixCls}-wrapper-checked`]: this.selected, |
44 | 44 | [`${prefixCls}-wrapper-disabled`]: this.disabled |
45 | 45 | } |
46 | - ] | |
46 | + ]; | |
47 | 47 | }, |
48 | 48 | radioClasses () { |
49 | 49 | return [ |
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | [`${prefixCls}-checked`]: this.selected, |
53 | 53 | [`${prefixCls}-disabled`]: this.disabled |
54 | 54 | } |
55 | - ] | |
55 | + ]; | |
56 | 56 | }, |
57 | 57 | innerClasses () { |
58 | 58 | return `${prefixCls}-inner`; |
... | ... | @@ -91,5 +91,5 @@ |
91 | 91 | this.updateModel(); |
92 | 92 | } |
93 | 93 | } |
94 | - } | |
95 | -</script> | |
96 | 94 | \ No newline at end of file |
95 | + }; | |
96 | +</script> | ... | ... |
src/components/select/dropdown.vue
src/components/select/option-group.vue
src/components/select/option.vue
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | isFocus: false, |
27 | 27 | hidden: false, // for search |
28 | 28 | searchLabel: '' // the value is slot,only for search |
29 | - } | |
29 | + }; | |
30 | 30 | }, |
31 | 31 | computed: { |
32 | 32 | classes () { |
... | ... | @@ -37,10 +37,10 @@ |
37 | 37 | [`${prefixCls}-selected`]: this.selected, |
38 | 38 | [`${prefixCls}-focus`]: this.isFocus |
39 | 39 | } |
40 | - ] | |
40 | + ]; | |
41 | 41 | }, |
42 | 42 | showLabel () { |
43 | - return (!!this.label) ? this.label : this.value; | |
43 | + return (this.label) ? this.label : this.value; | |
44 | 44 | } |
45 | 45 | }, |
46 | 46 | methods: { |
... | ... | @@ -69,5 +69,5 @@ |
69 | 69 | this.queryChange(val); |
70 | 70 | } |
71 | 71 | } |
72 | - } | |
73 | -</script> | |
74 | 72 | \ No newline at end of file |
73 | + }; | |
74 | +</script> | ... | ... |
src/components/select/select.vue
... | ... | @@ -96,7 +96,7 @@ |
96 | 96 | inputLength: 20, |
97 | 97 | notFound: false, |
98 | 98 | slotChangeDuration: false // if slot change duration and in multiple, set true and after slot change, set false |
99 | - } | |
99 | + }; | |
100 | 100 | }, |
101 | 101 | computed: { |
102 | 102 | classes () { |
... | ... | @@ -110,7 +110,7 @@ |
110 | 110 | [`${prefixCls}-show-clear`]: this.showCloseIcon, |
111 | 111 | [`${prefixCls}-${this.size}`]: !!this.size |
112 | 112 | } |
113 | - ] | |
113 | + ]; | |
114 | 114 | }, |
115 | 115 | showPlaceholder () { |
116 | 116 | let status = false; |
... | ... | @@ -174,7 +174,7 @@ |
174 | 174 | if (this.optionInstances.length) { |
175 | 175 | this.optionInstances.forEach((child) => { |
176 | 176 | find(child); |
177 | - }) | |
177 | + }); | |
178 | 178 | } else { |
179 | 179 | this.$children.forEach((child) => { |
180 | 180 | find(child); |
... | ... | @@ -252,7 +252,7 @@ |
252 | 252 | selected.push({ |
253 | 253 | value: option.value, |
254 | 254 | label: option.label |
255 | - }) | |
255 | + }); | |
256 | 256 | } |
257 | 257 | } |
258 | 258 | } |
... | ... | @@ -435,7 +435,7 @@ |
435 | 435 | const model = this.model; |
436 | 436 | |
437 | 437 | if (this.multiple) { |
438 | - | |
438 | + // | |
439 | 439 | } else { |
440 | 440 | if (model !== '') { |
441 | 441 | this.findChild((child) => { |
... | ... | @@ -561,5 +561,5 @@ |
561 | 561 | } |
562 | 562 | } |
563 | 563 | } |
564 | - } | |
564 | + }; | |
565 | 565 | </script> | ... | ... |
src/components/slider/slider.vue
... | ... | @@ -109,7 +109,7 @@ |
109 | 109 | singlePosition: (this.value - this.min) / (this.max - this.min) * 100, |
110 | 110 | firstPosition: (this.value[0] - this.min) / (this.max - this.min) * 100, |
111 | 111 | secondPosition: (this.value[1] - this.min) / (this.max - this.min) * 100 |
112 | - } | |
112 | + }; | |
113 | 113 | }, |
114 | 114 | computed: { |
115 | 115 | classes () { |
... | ... | @@ -120,7 +120,7 @@ |
120 | 120 | [`${prefixCls}-range`]: this.range, |
121 | 121 | [`${prefixCls}-disabled`]: this.disabled |
122 | 122 | } |
123 | - ] | |
123 | + ]; | |
124 | 124 | }, |
125 | 125 | buttonClasses () { |
126 | 126 | return [ |
... | ... | @@ -153,11 +153,11 @@ |
153 | 153 | style = { |
154 | 154 | width: (this.value[1] - this.value[0]) / (this.max - this.min) * 100 + '%', |
155 | 155 | left: (this.value[0] - this.min) / (this.max - this.min) * 100 + '%' |
156 | - } | |
156 | + }; | |
157 | 157 | } else { |
158 | 158 | style = { |
159 | 159 | width: (this.value - this.min) / (this.max - this.min) * 100 + '%' |
160 | - } | |
160 | + }; | |
161 | 161 | } |
162 | 162 | |
163 | 163 | return style; |
... | ... | @@ -418,5 +418,5 @@ |
418 | 418 | this.updateValue(this.value); |
419 | 419 | } |
420 | 420 | } |
421 | - } | |
422 | -</script> | |
423 | 421 | \ No newline at end of file |
422 | + }; | |
423 | +</script> | ... | ... |
src/components/spin/spin.vue
... | ... | @@ -26,7 +26,7 @@ |
26 | 26 | data () { |
27 | 27 | return { |
28 | 28 | showText: false |
29 | - } | |
29 | + }; | |
30 | 30 | }, |
31 | 31 | computed: { |
32 | 32 | classes () { |
... | ... | @@ -37,7 +37,7 @@ |
37 | 37 | [`${prefixCls}-fix`]: this.fix, |
38 | 38 | [`${prefixCls}-show-text`]: this.showText, |
39 | 39 | } |
40 | - ] | |
40 | + ]; | |
41 | 41 | }, |
42 | 42 | mainClasses () { |
43 | 43 | return `${prefixCls}-main`; |
... | ... | @@ -56,5 +56,5 @@ |
56 | 56 | this.showText = true; |
57 | 57 | } |
58 | 58 | } |
59 | - } | |
60 | -</script> | |
61 | 59 | \ No newline at end of file |
60 | + }; | |
61 | +</script> | ... | ... |
src/components/steps/step.vue
... | ... | @@ -43,7 +43,7 @@ |
43 | 43 | stepNumber: '', |
44 | 44 | nextError: false, |
45 | 45 | total: 1 |
46 | - } | |
46 | + }; | |
47 | 47 | }, |
48 | 48 | computed: { |
49 | 49 | wrapClasses () { |
... | ... | @@ -54,12 +54,12 @@ |
54 | 54 | [`${prefixCls}-custom`]: !!this.icon, |
55 | 55 | [`${prefixCls}-next-error`]: this.nextError |
56 | 56 | } |
57 | - ] | |
57 | + ]; | |
58 | 58 | }, |
59 | 59 | iconClasses () { |
60 | 60 | let icon = ''; |
61 | 61 | |
62 | - if (!!this.icon) { | |
62 | + if (this.icon) { | |
63 | 63 | icon = this.icon; |
64 | 64 | } else { |
65 | 65 | if (this.status == 'finish') { |
... | ... | @@ -75,12 +75,12 @@ |
75 | 75 | { |
76 | 76 | [`${iconPrefixCls}-${icon}`]: icon != '' |
77 | 77 | } |
78 | - ] | |
78 | + ]; | |
79 | 79 | }, |
80 | 80 | styles () { |
81 | 81 | return { |
82 | 82 | width: `${1/this.total*100}%` |
83 | - } | |
83 | + }; | |
84 | 84 | } |
85 | 85 | }, |
86 | 86 | watch: { |
... | ... | @@ -90,5 +90,5 @@ |
90 | 90 | } |
91 | 91 | } |
92 | 92 | } |
93 | - } | |
93 | + }; | |
94 | 94 | </script> | ... | ... |
src/components/steps/steps.vue
... | ... | @@ -40,7 +40,7 @@ |
40 | 40 | { |
41 | 41 | [`${prefixCls}-${this.size}`]: !!this.size |
42 | 42 | } |
43 | - ] | |
43 | + ]; | |
44 | 44 | } |
45 | 45 | }, |
46 | 46 | ready () { |
... | ... | @@ -103,5 +103,5 @@ |
103 | 103 | this.updateCurrent(); |
104 | 104 | } |
105 | 105 | } |
106 | - } | |
107 | -</script> | |
108 | 106 | \ No newline at end of file |
107 | + }; | |
108 | +</script> | ... | ... |
src/components/switch/switch.vue
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | [`${prefixCls}-disabled`]: this.disabled, |
37 | 37 | [`${prefixCls}-${this.size}`]: !!this.size |
38 | 38 | } |
39 | - ] | |
39 | + ]; | |
40 | 40 | }, |
41 | 41 | innerClasses () { |
42 | 42 | return `${prefixCls}-inner`; |
... | ... | @@ -52,5 +52,5 @@ |
52 | 52 | this.$emit('on-change', this.checked); |
53 | 53 | } |
54 | 54 | } |
55 | - } | |
56 | -</script> | |
57 | 55 | \ No newline at end of file |
56 | + }; | |
57 | +</script> | ... | ... |
src/components/table/cell.vue
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 | renderType: '', |
30 | 30 | uid: -1, |
31 | 31 | content: this.$parent.$parent.content |
32 | - } | |
32 | + }; | |
33 | 33 | }, |
34 | 34 | computed: { |
35 | 35 | classes () { |
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | { |
39 | 39 | [`${this.prefixCls}-hidden`]: !this.fixed && this.column.fixed && (this.column.fixed === 'left' || this.column.fixed === 'right') |
40 | 40 | } |
41 | - ] | |
41 | + ]; | |
42 | 42 | } |
43 | 43 | }, |
44 | 44 | methods: { |
... | ... | @@ -94,5 +94,5 @@ |
94 | 94 | this.compile(); |
95 | 95 | } |
96 | 96 | } |
97 | - } | |
98 | -</script> | |
99 | 97 | \ No newline at end of file |
98 | + }; | |
99 | +</script> | ... | ... |
src/components/table/export-csv.js
... | ... | @@ -3,11 +3,11 @@ function has (browser) { |
3 | 3 | if (browser === 'ie') { |
4 | 4 | const isIE = ua.indexOf('compatible') > -1 && ua.indexOf('MSIE') > -1; |
5 | 5 | if (isIE) { |
6 | - const reIE = new RegExp("MSIE (\\d+\\.\\d+);"); | |
6 | + const reIE = new RegExp('MSIE (\\d+\\.\\d+);'); | |
7 | 7 | reIE.test(ua); |
8 | - return parseFloat(RegExp["$1"]); | |
8 | + return parseFloat(RegExp['$1']); | |
9 | 9 | } else { |
10 | - return false | |
10 | + return false; | |
11 | 11 | } |
12 | 12 | } else { |
13 | 13 | return ua.indexOf(browser) > -1; |
... | ... | @@ -19,12 +19,12 @@ const csv = { |
19 | 19 | let iev = 0; |
20 | 20 | const ieold = (/MSIE (\d+\.\d+);/.test(navigator.userAgent)); |
21 | 21 | const trident = !!navigator.userAgent.match(/Trident\/7.0/); |
22 | - const rv = navigator.userAgent.indexOf("rv:11.0"); | |
22 | + const rv = navigator.userAgent.indexOf('rv:11.0'); | |
23 | 23 | |
24 | 24 | if (ieold) { |
25 | 25 | iev = Number(RegExp.$1); |
26 | 26 | } |
27 | - if (navigator.appVersion.indexOf("MSIE 10") !== -1) { | |
27 | + if (navigator.appVersion.indexOf('MSIE 10') !== -1) { | |
28 | 28 | iev = 10; |
29 | 29 | } |
30 | 30 | if (trident && rv !== -1) { |
... | ... | @@ -39,7 +39,7 @@ const csv = { |
39 | 39 | }, |
40 | 40 | |
41 | 41 | _getDownloadUrl (text) { |
42 | - const BOM = "\uFEFF"; | |
42 | + const BOM = '\uFEFF'; | |
43 | 43 | // Add BOM to text for open in excel correctly |
44 | 44 | if (window.Blob && window.URL && window.URL.createObjectURL && !has('Safari')) { |
45 | 45 | const csvData = new Blob([BOM + text], { type: 'text/csv' }); |
... | ... | @@ -52,14 +52,14 @@ const csv = { |
52 | 52 | download (filename, text) { |
53 | 53 | if (has('ie') && has('ie') < 10) { |
54 | 54 | // has module unable identify ie11 and Edge |
55 | - const oWin = window.top.open("about:blank", "_blank"); | |
55 | + const oWin = window.top.open('about:blank', '_blank'); | |
56 | 56 | oWin.document.charset = 'utf-8'; |
57 | 57 | oWin.document.write(text); |
58 | 58 | oWin.document.close(); |
59 | 59 | oWin.document.execCommand('SaveAs', filename); |
60 | 60 | oWin.close(); |
61 | - } else if (has("ie") === 10 || this._isIE11() || this._isEdge()) { | |
62 | - const BOM = "\uFEFF"; | |
61 | + } else if (has('ie') === 10 || this._isIE11() || this._isEdge()) { | |
62 | + const BOM = '\uFEFF'; | |
63 | 63 | const csvData = new Blob([BOM + text], { type: 'text/csv' }); |
64 | 64 | navigator.msSaveBlob(csvData, filename); |
65 | 65 | } else { | ... | ... |
src/components/table/mixin.js
... | ... | @@ -6,21 +6,21 @@ export default { |
6 | 6 | [`${this.prefixCls}-column-${column.align}`]: column.align, |
7 | 7 | [`${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')) |
8 | 8 | } |
9 | - ] | |
9 | + ]; | |
10 | 10 | }, |
11 | 11 | isPopperShow (column) { |
12 | 12 | return column.filters && ((!this.fixed && !column.fixed) || (this.fixed === 'left' && column.fixed === 'left') || (this.fixed === 'right' && column.fixed === 'right')); |
13 | 13 | }, |
14 | - setCellWidth (column, index) { | |
14 | + setCellWidth (column) { | |
15 | 15 | // return column.width ? column.width : this.columnsWidth[index]; |
16 | 16 | let width = ''; |
17 | 17 | if (column.width) { |
18 | 18 | width = column.width; |
19 | 19 | } else if (this.columnsWidth[column._index]) { |
20 | - width = this.columnsWidth[column._index].width | |
20 | + width = this.columnsWidth[column._index].width; | |
21 | 21 | } |
22 | 22 | // return this.columnsWidth[column._index] ? this.columnsWidth[column._index].width : ''; |
23 | 23 | return width; |
24 | 24 | } |
25 | 25 | } |
26 | -} | |
27 | 26 | \ No newline at end of file |
27 | +}; | ... | ... |
src/components/table/table-body.vue
... | ... | @@ -52,7 +52,7 @@ |
52 | 52 | [`${this.prefixCls}-row-highlight`]: this.objData[_index] && this.objData[_index]._isHighlight, |
53 | 53 | [`${this.prefixCls}-row-hover`]: this.objData[_index] && this.objData[_index]._isHover |
54 | 54 | } |
55 | - ] | |
55 | + ]; | |
56 | 56 | }, |
57 | 57 | rowChecked (_index) { |
58 | 58 | return this.objData[_index] && this.objData[_index]._isChecked; |
... | ... | @@ -70,5 +70,5 @@ |
70 | 70 | this.$parent.highlightCurrentRow(_index); |
71 | 71 | } |
72 | 72 | } |
73 | - } | |
74 | -</script> | |
75 | 73 | \ No newline at end of file |
74 | + }; | |
75 | +</script> | ... | ... |
src/components/table/table-head.vue
... | ... | @@ -58,7 +58,6 @@ |
58 | 58 | import Poptip from '../poptip/poptip.vue'; |
59 | 59 | import iButton from '../button/button.vue'; |
60 | 60 | import Mixin from './mixin'; |
61 | - import { deepCopy } from '../../utils/assist'; | |
62 | 61 | |
63 | 62 | export default { |
64 | 63 | mixins: [ Mixin ], |
... | ... | @@ -97,7 +96,7 @@ |
97 | 96 | { |
98 | 97 | [`${this.prefixCls}-hidden`]: !this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right') |
99 | 98 | } |
100 | - ] | |
99 | + ]; | |
101 | 100 | }, |
102 | 101 | itemClasses (column, item) { |
103 | 102 | return [ |
... | ... | @@ -105,7 +104,7 @@ |
105 | 104 | { |
106 | 105 | [`${this.prefixCls}-filter-select-item-selected`]: column._filterChecked[0] === item.value |
107 | 106 | } |
108 | - ] | |
107 | + ]; | |
109 | 108 | }, |
110 | 109 | itemAllClasses (column) { |
111 | 110 | return [ |
... | ... | @@ -113,7 +112,7 @@ |
113 | 112 | { |
114 | 113 | [`${this.prefixCls}-filter-select-item-selected`]: !column._filterChecked.length |
115 | 114 | } |
116 | - ] | |
115 | + ]; | |
117 | 116 | }, |
118 | 117 | renderHeader (column, $index) { |
119 | 118 | if ('renderHeader' in this.columns[$index]) { |
... | ... | @@ -145,5 +144,5 @@ |
145 | 144 | this.$parent.handleFilterHide(index); |
146 | 145 | } |
147 | 146 | } |
148 | - } | |
149 | -</script> | |
150 | 147 | \ No newline at end of file |
148 | + }; | |
149 | +</script> | ... | ... |
src/components/table/table.vue
... | ... | @@ -83,13 +83,13 @@ |
83 | 83 | data: { |
84 | 84 | type: Array, |
85 | 85 | default () { |
86 | - return [] | |
86 | + return []; | |
87 | 87 | } |
88 | 88 | }, |
89 | 89 | columns: { |
90 | 90 | type: Array, |
91 | 91 | default () { |
92 | - return [] | |
92 | + return []; | |
93 | 93 | } |
94 | 94 | }, |
95 | 95 | size: { |
... | ... | @@ -142,7 +142,7 @@ |
142 | 142 | showSlotHeader: true, |
143 | 143 | showSlotFooter: true, |
144 | 144 | bodyHeight: 0 |
145 | - } | |
145 | + }; | |
146 | 146 | }, |
147 | 147 | computed: { |
148 | 148 | wrapClasses () { |
... | ... | @@ -153,7 +153,7 @@ |
153 | 153 | [`${prefixCls}-with-header`]: this.showSlotHeader, |
154 | 154 | [`${prefixCls}-with-footer`]: this.showSlotFooter |
155 | 155 | } |
156 | - ] | |
156 | + ]; | |
157 | 157 | }, |
158 | 158 | classes () { |
159 | 159 | return [ |
... | ... | @@ -164,12 +164,12 @@ |
164 | 164 | [`${prefixCls}-stripe`]: this.stripe, |
165 | 165 | [`${prefixCls}-with-fixed-top`]: !!this.height |
166 | 166 | } |
167 | - ] | |
167 | + ]; | |
168 | 168 | }, |
169 | 169 | styles () { |
170 | 170 | let style = {}; |
171 | - if (!!this.height) style.height = `${this.height}px`; | |
172 | - if (!!this.width) style.width = `${this.width}px`; | |
171 | + if (this.height) style.height = `${this.height}px`; | |
172 | + if (this.width) style.width = `${this.width}px`; | |
173 | 173 | return style; |
174 | 174 | }, |
175 | 175 | tableStyle () { |
... | ... | @@ -269,7 +269,7 @@ |
269 | 269 | |
270 | 270 | columnsWidth[column._index] = { |
271 | 271 | width: width |
272 | - } | |
272 | + }; | |
273 | 273 | } |
274 | 274 | this.columnsWidth = columnsWidth; |
275 | 275 | } |
... | ... | @@ -334,13 +334,13 @@ |
334 | 334 | this.$emit('on-selection-change', selection); |
335 | 335 | }, |
336 | 336 | fixedHeader () { |
337 | - if (!!this.height) { | |
337 | + if (this.height) { | |
338 | 338 | this.$nextTick(() => { |
339 | 339 | const titleHeight = parseInt(getStyle(this.$els.title, 'height')) || 0; |
340 | 340 | const headerHeight = parseInt(getStyle(this.$els.header, 'height')) || 0; |
341 | 341 | const footerHeight = parseInt(getStyle(this.$els.footer, 'height')) || 0; |
342 | 342 | this.bodyHeight = this.height - titleHeight - headerHeight - footerHeight; |
343 | - }) | |
343 | + }); | |
344 | 344 | } else { |
345 | 345 | this.bodyHeight = 0; |
346 | 346 | } |
... | ... | @@ -584,5 +584,5 @@ |
584 | 584 | this.fixedHeader(); |
585 | 585 | } |
586 | 586 | } |
587 | - } | |
588 | -</script> | |
589 | 587 | \ No newline at end of file |
588 | + }; | |
589 | +</script> | ... | ... |
src/components/tabs/pane.vue
src/components/tabs/tabs.vue
... | ... | @@ -58,7 +58,7 @@ |
58 | 58 | navList: [], |
59 | 59 | barWidth: 0, |
60 | 60 | barOffset: 0 |
61 | - } | |
61 | + }; | |
62 | 62 | }, |
63 | 63 | computed: { |
64 | 64 | classes () { |
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 | [`${prefixCls}-mini`]: this.size === 'small' && this.type === 'line', |
70 | 70 | [`${prefixCls}-no-animation`]: !this.animated |
71 | 71 | } |
72 | - ] | |
72 | + ]; | |
73 | 73 | }, |
74 | 74 | contentClasses () { |
75 | 75 | return [ |
... | ... | @@ -77,7 +77,7 @@ |
77 | 77 | { |
78 | 78 | [`${prefixCls}-content-animated`]: this.animated |
79 | 79 | } |
80 | - ] | |
80 | + ]; | |
81 | 81 | }, |
82 | 82 | barClasses () { |
83 | 83 | return [ |
... | ... | @@ -85,17 +85,17 @@ |
85 | 85 | { |
86 | 86 | [`${prefixCls}-ink-bar-animated`]: this.animated |
87 | 87 | } |
88 | - ] | |
88 | + ]; | |
89 | 89 | }, |
90 | 90 | contentStyle () { |
91 | - const x = this.navList.findIndex((nav, index) => nav.key === this.activeKey); | |
91 | + const x = this.navList.findIndex((nav) => nav.key === this.activeKey); | |
92 | 92 | const p = x === 0 ? '0%' : `-${x}00%`; |
93 | 93 | |
94 | 94 | let style = {}; |
95 | 95 | if (x > -1) { |
96 | 96 | style = { |
97 | 97 | transform: `translateX(${p}) translateZ(0px)` |
98 | - } | |
98 | + }; | |
99 | 99 | } |
100 | 100 | return style; |
101 | 101 | }, |
... | ... | @@ -137,7 +137,7 @@ |
137 | 137 | }, |
138 | 138 | updateBar () { |
139 | 139 | this.$nextTick(() => { |
140 | - const index = this.navList.findIndex((nav, index) => nav.key === this.activeKey); | |
140 | + const index = this.navList.findIndex((nav) => nav.key === this.activeKey); | |
141 | 141 | const prevTabs = this.$els.nav.querySelectorAll(`.${prefixCls}-tab`); |
142 | 142 | const tab = prevTabs[index]; |
143 | 143 | this.barWidth = parseFloat(getStyle(tab, 'width')); |
... | ... | @@ -166,7 +166,7 @@ |
166 | 166 | [`${prefixCls}-tab-disabled`]: item.disabled, |
167 | 167 | [`${prefixCls}-tab-active`]: item.key === this.activeKey |
168 | 168 | } |
169 | - ] | |
169 | + ]; | |
170 | 170 | }, |
171 | 171 | handleChange (index) { |
172 | 172 | const nav = this.navList[index]; |
... | ... | @@ -210,5 +210,5 @@ |
210 | 210 | this.updateBar(); |
211 | 211 | } |
212 | 212 | } |
213 | - } | |
214 | -</script> | |
215 | 213 | \ No newline at end of file |
214 | + }; | |
215 | +</script> | ... | ... |
src/components/tag/tag.vue
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | data () { |
31 | 31 | return { |
32 | 32 | closed: false |
33 | - } | |
33 | + }; | |
34 | 34 | }, |
35 | 35 | computed: { |
36 | 36 | classes () { |
... | ... | @@ -41,7 +41,7 @@ |
41 | 41 | [`${prefixCls}-${this.type}`]: !!this.type, |
42 | 42 | [`${prefixCls}-closable`]: this.closable |
43 | 43 | } |
44 | - ] | |
44 | + ]; | |
45 | 45 | }, |
46 | 46 | textClasses () { |
47 | 47 | return `${prefixCls}-text`; |
... | ... | @@ -59,5 +59,5 @@ |
59 | 59 | this.$emit('on-close', e); |
60 | 60 | } |
61 | 61 | } |
62 | - } | |
63 | -</script> | |
64 | 62 | \ No newline at end of file |
63 | + }; | |
64 | +</script> | ... | ... |
src/components/timeline/timeline-item.vue
... | ... | @@ -20,7 +20,7 @@ |
20 | 20 | data () { |
21 | 21 | return { |
22 | 22 | dot: false |
23 | - } | |
23 | + }; | |
24 | 24 | }, |
25 | 25 | ready () { |
26 | 26 | this.dot = this.$els.dot.innerHTML.length ? true : false; |
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | [`${prefixCls}-item-head-custom`]: this.dot, |
40 | 40 | [`${prefixCls}-item-head-${this.color}`]: this.headColorShow |
41 | 41 | } |
42 | - ] | |
42 | + ]; | |
43 | 43 | }, |
44 | 44 | headColorShow () { |
45 | 45 | return this.color == 'blue' || this.color == 'red' || this.color == 'green'; |
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | style = { |
52 | 52 | 'color': this.color, |
53 | 53 | 'border-color': this.color |
54 | - } | |
54 | + }; | |
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
... | ... | @@ -61,5 +61,5 @@ |
61 | 61 | return `${prefixCls}-item-content`; |
62 | 62 | } |
63 | 63 | } |
64 | - } | |
65 | -</script> | |
66 | 64 | \ No newline at end of file |
65 | + }; | |
66 | +</script> | ... | ... |
src/components/timeline/timeline.vue
src/components/tooltip/tooltip.vue
src/components/transfer/list.vue
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | showItems: [], |
51 | 51 | query: '', |
52 | 52 | showFooter: true |
53 | - } | |
53 | + }; | |
54 | 54 | }, |
55 | 55 | computed: { |
56 | 56 | classes () { |
... | ... | @@ -59,7 +59,7 @@ |
59 | 59 | { |
60 | 60 | [`${this.prefixCls}-with-footer`]: this.showFooter |
61 | 61 | } |
62 | - ] | |
62 | + ]; | |
63 | 63 | }, |
64 | 64 | bodyClasses () { |
65 | 65 | return [ |
... | ... | @@ -68,7 +68,7 @@ |
68 | 68 | [`${this.prefixCls}-body-with-search`]: this.filterable, |
69 | 69 | [`${this.prefixCls}-body-with-footer`]: this.showFooter |
70 | 70 | } |
71 | - ] | |
71 | + ]; | |
72 | 72 | }, |
73 | 73 | count () { |
74 | 74 | const validKeysCount = this.validKeysCount; |
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 | { |
89 | 89 | [`${this.prefixCls}-content-item-disabled`]: item.disabled |
90 | 90 | } |
91 | - ] | |
91 | + ]; | |
92 | 92 | }, |
93 | 93 | showLabel (item) { |
94 | 94 | return this.renderFormat(item); |
... | ... | @@ -125,5 +125,5 @@ |
125 | 125 | this.updateFilteredData(); |
126 | 126 | } |
127 | 127 | } |
128 | - } | |
128 | + }; | |
129 | 129 | </script> | ... | ... |
src/components/transfer/operation.vue
src/components/transfer/search.vue
src/components/transfer/transfer.vue
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 | data: { |
48 | 48 | type: Array, |
49 | 49 | default () { |
50 | - return [] | |
50 | + return []; | |
51 | 51 | } |
52 | 52 | }, |
53 | 53 | renderFormat: { |
... | ... | @@ -59,31 +59,31 @@ |
59 | 59 | targetKeys: { |
60 | 60 | type: Array, |
61 | 61 | default () { |
62 | - return [] | |
62 | + return []; | |
63 | 63 | } |
64 | 64 | }, |
65 | 65 | selectedKeys: { |
66 | 66 | type: Array, |
67 | 67 | default () { |
68 | - return [] | |
68 | + return []; | |
69 | 69 | } |
70 | 70 | }, |
71 | 71 | listStyle: { |
72 | 72 | type: Object, |
73 | 73 | default () { |
74 | - return {} | |
74 | + return {}; | |
75 | 75 | } |
76 | 76 | }, |
77 | 77 | titles: { |
78 | 78 | type: Array, |
79 | 79 | default () { |
80 | - return ['源列表', '目的列表'] | |
80 | + return ['源列表', '目的列表']; | |
81 | 81 | } |
82 | 82 | }, |
83 | 83 | operations: { |
84 | 84 | type: Array, |
85 | 85 | default () { |
86 | - return [] | |
86 | + return []; | |
87 | 87 | } |
88 | 88 | }, |
89 | 89 | filterable: { |
... | ... | @@ -113,13 +113,13 @@ |
113 | 113 | rightData: [], |
114 | 114 | leftCheckedKeys: [], |
115 | 115 | rightCheckedKeys: [] |
116 | - } | |
116 | + }; | |
117 | 117 | }, |
118 | 118 | computed: { |
119 | 119 | classes () { |
120 | 120 | return [ |
121 | 121 | `${prefixCls}` |
122 | - ] | |
122 | + ]; | |
123 | 123 | }, |
124 | 124 | leftValidKeysCount () { |
125 | 125 | return this.getValidKeys('left').length; |
... | ... | @@ -182,5 +182,5 @@ |
182 | 182 | created () { |
183 | 183 | this.splitData(true); |
184 | 184 | } |
185 | - } | |
186 | -</script> | |
187 | 185 | \ No newline at end of file |
186 | + }; | |
187 | +</script> | ... | ... |
src/directives/clickoutside.js
src/index.js
1 | 1 | // es6 polyfill |
2 | -import 'core-js/fn/array/find-index' | |
2 | +import 'core-js/fn/array/find-index'; | |
3 | 3 | |
4 | 4 | import Affix from './components/affix'; |
5 | 5 | import Alert from './components/alert'; |
... | ... | @@ -97,7 +97,7 @@ const iview = { |
97 | 97 | |
98 | 98 | const install = function (Vue) { |
99 | 99 | Object.keys(iview).forEach((key) => { |
100 | - Vue.component(key, iview[key]) | |
100 | + Vue.component(key, iview[key]); | |
101 | 101 | }); |
102 | 102 | |
103 | 103 | Vue.prototype.$Loading = LoadingBar; |
... | ... | @@ -111,4 +111,4 @@ if (typeof window !== 'undefined' && window.Vue) { |
111 | 111 | install(window.Vue); |
112 | 112 | } |
113 | 113 | |
114 | -module.exports = Object.assign(iview, {install}); | |
114 | +module.exports = Object.assign(iview, {install}); // eslint-disable-line no-undef | ... | ... |
src/utils/assist.js
src/utils/calcTextareaHeight.js