diff --git a/.eslintrc b/.eslintrc index 12d1b974b..d0707a444 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,7 +1,4 @@ { "root": true, - "extends": ["@vant"], - "rules": { - "no-unused-vars": ["error", { "vars": "all", "args": "none" }] - } + "extends": ["@vant"] } diff --git a/package.json b/package.json index 1deb1a5e7..e423c2aad 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "@babel/preset-typescript": "^7.3.3", "@types/jest": "^24.0.15", "@vant/doc": "^2.3.6", - "@vant/eslint-config": "^1.2.0", + "@vant/eslint-config": "^1.2.3", "@vant/markdown-loader": "^2.1.2", "@vant/markdown-vetur": "^1.0.0", "@vant/touch-emulator": "^1.1.0", diff --git a/src/address-edit/Detail.js b/src/address-edit/Detail.js index 63221c3be..570382794 100644 --- a/src/address-edit/Detail.js +++ b/src/address-edit/Detail.js @@ -61,7 +61,7 @@ export default createComponent({ } }, - render(h) { + render() { return ( () => this.onFocus(name); diff --git a/src/area/index.js b/src/area/index.js index 1c2037b03..05423c6e4 100644 --- a/src/area/index.js +++ b/src/area/index.js @@ -183,7 +183,7 @@ export default createComponent({ } }, - render(h) { + render() { const on = { ...this.$listeners, change: this.onChange diff --git a/src/checkbox-group/index.js b/src/checkbox-group/index.js index 332ac5948..c902612c2 100644 --- a/src/checkbox-group/index.js +++ b/src/checkbox-group/index.js @@ -21,7 +21,7 @@ export default createComponent({ } }, - render(h) { + render() { return
{this.slots()}
; } }); diff --git a/src/circle/index.js b/src/circle/index.js index 54738b5e7..922f9a336 100644 --- a/src/circle/index.js +++ b/src/circle/index.js @@ -112,7 +112,7 @@ export default createComponent({ } }, - render(h) { + render() { return (
diff --git a/src/col/index.js b/src/col/index.js index ccd3360c8..ac1ffc99e 100644 --- a/src/col/index.js +++ b/src/col/index.js @@ -23,7 +23,7 @@ export default createComponent({ } }, - render(h) { + render() { const { span, offset } = this; return ( diff --git a/src/collapse-item/index.js b/src/collapse-item/index.js index 3f21393ff..079e84cfe 100644 --- a/src/collapse-item/index.js +++ b/src/collapse-item/index.js @@ -107,7 +107,7 @@ export default createComponent({ } }, - render(h) { + render() { const { disabled, expanded } = this; const titleSlots = CELL_SLOTS.reduce((slots, name) => { diff --git a/src/collapse/index.js b/src/collapse/index.js index 8a15340e1..1d75a8f1e 100644 --- a/src/collapse/index.js +++ b/src/collapse/index.js @@ -27,7 +27,7 @@ export default createComponent({ } }, - render(h) { + render() { return (
{this.slots()} diff --git a/src/contact-edit/index.js b/src/contact-edit/index.js index 45107b364..9b3f50480 100644 --- a/src/contact-edit/index.js +++ b/src/contact-edit/index.js @@ -88,7 +88,7 @@ export default createComponent({ } }, - render(h) { + render() { const { data, errorInfo } = this; const onFocus = name => () => this.onFocus(name); diff --git a/src/count-down/index.js b/src/count-down/index.js index 928f4298a..d81229a92 100644 --- a/src/count-down/index.js +++ b/src/count-down/index.js @@ -117,7 +117,7 @@ export default createComponent({ } }, - render(h) { + render() { return (
{this.slots('default', this.timeData) || this.formattedTime} diff --git a/src/count-down/test/index.spec.js b/src/count-down/test/index.spec.js index eb5226990..76ecfe3cd 100644 --- a/src/count-down/test/index.spec.js +++ b/src/count-down/test/index.spec.js @@ -85,7 +85,7 @@ test('start method', async () => { wrapper.vm.start(); wrapper.vm.start(); - await later(20); + await later(50); const laterShapShot = wrapper.html(); diff --git a/src/coupon-list/index.js b/src/coupon-list/index.js index beb94fba7..fa1694432 100644 --- a/src/coupon-list/index.js +++ b/src/coupon-list/index.js @@ -153,7 +153,7 @@ export default createComponent({ } }, - render(h) { + render() { const { coupons, disabledCoupons } = this; const title = `${this.enabledTitle || t('enable')} (${coupons.length})`; const disabledTitle = `${this.disabledTitle || t('disabled')} (${ diff --git a/src/coupon/index.js b/src/coupon/index.js index d78539b65..7047b9afb 100644 --- a/src/coupon/index.js +++ b/src/coupon/index.js @@ -61,7 +61,7 @@ export default createComponent({ } }, - render(h) { + render() { const { coupon, disabled } = this; const description = (disabled && coupon.reason) || coupon.description; diff --git a/src/datetime-picker/index.js b/src/datetime-picker/index.js index 297f1a91e..a67449c68 100644 --- a/src/datetime-picker/index.js +++ b/src/datetime-picker/index.js @@ -313,7 +313,7 @@ export default createComponent({ } }, - render(h) { + render() { const props = {}; Object.keys(pickerProps).forEach(key => { props[key] = this[key]; diff --git a/src/dialog/Dialog.js b/src/dialog/Dialog.js index 3b602798e..490822474 100644 --- a/src/dialog/Dialog.js +++ b/src/dialog/Dialog.js @@ -73,7 +73,7 @@ export default createComponent({ } }, - render(h) { + render() { if (!this.shouldRender) { return; } diff --git a/src/dropdown-item/index.js b/src/dropdown-item/index.js index 6efddc2eb..78923d1ac 100644 --- a/src/dropdown-item/index.js +++ b/src/dropdown-item/index.js @@ -63,7 +63,7 @@ export default createComponent({ this.onOpened = createEmitter('opened'); }, - render(h) { + render() { const { zIndex, offset, diff --git a/src/dropdown-menu/index.js b/src/dropdown-menu/index.js index 16a03eb9b..a1a7fc587 100644 --- a/src/dropdown-menu/index.js +++ b/src/dropdown-menu/index.js @@ -76,7 +76,7 @@ export default createComponent({ } }, - render(h) { + render() { const Titles = this.children.map((item, index) => (
{this.slots('icon') ? ( diff --git a/src/goods-action/index.js b/src/goods-action/index.js index 38574af2f..121725664 100644 --- a/src/goods-action/index.js +++ b/src/goods-action/index.js @@ -10,7 +10,7 @@ export default createComponent({ safeAreaInsetBottom: Boolean }, - render(h) { + render() { return (
{this.slots()} diff --git a/src/grid-item/index.js b/src/grid-item/index.js index a48965f3d..7a091d67f 100644 --- a/src/grid-item/index.js +++ b/src/grid-item/index.js @@ -72,7 +72,7 @@ export default createComponent({ } }, - render(h) { + render() { const { center, border, square, gutter, clickable } = this.parent; return ( diff --git a/src/grid/index.js b/src/grid/index.js index 1f1af856a..f609c6edd 100644 --- a/src/grid/index.js +++ b/src/grid/index.js @@ -36,7 +36,7 @@ export default createComponent({ } }, - render(h) { + render() { return (
{this.renderImage()} diff --git a/src/index-anchor/index.js b/src/index-anchor/index.js index acb726ded..3b2394f59 100644 --- a/src/index-anchor/index.js +++ b/src/index-anchor/index.js @@ -43,7 +43,7 @@ export default createComponent({ } }, - render(h) { + render() { const { sticky } = this; return ( diff --git a/src/index-bar/index.js b/src/index-bar/index.js index 9d08b491c..df7c3133b 100644 --- a/src/index-bar/index.js +++ b/src/index-bar/index.js @@ -154,7 +154,7 @@ export default createComponent({ } }, - scrollToElement(element, setActive) { + scrollToElement(element) { const { index } = element.dataset; if (!index) { return; @@ -177,7 +177,7 @@ export default createComponent({ } }, - render(h) { + render() { const Indexes = this.indexList.map(index => { const active = index === this.activeAnchorIndex; diff --git a/src/list/index.js b/src/list/index.js index 3cb18fe68..24cad0d96 100644 --- a/src/list/index.js +++ b/src/list/index.js @@ -104,7 +104,7 @@ export default createComponent({ } }, - render(h) { + render() { const Placeholder =
; return ( diff --git a/src/mixins/checkbox.js b/src/mixins/checkbox.js index cd482e48d..068c15d23 100644 --- a/src/mixins/checkbox.js +++ b/src/mixins/checkbox.js @@ -46,7 +46,7 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({ } }, - render(h) { + render() { const { slots, checked } = this; const CheckIcon = slots('icon', { checked }) || ( diff --git a/src/notice-bar/index.js b/src/notice-bar/index.js index 36661281b..ca557f5ff 100644 --- a/src/notice-bar/index.js +++ b/src/notice-bar/index.js @@ -76,7 +76,7 @@ export default createComponent({ } }, - render(h) { + render() { const { slots, mode, leftIcon, onClickIcon } = this; const barStyle = { diff --git a/src/number-keyboard/Key.js b/src/number-keyboard/Key.js index bf72ecd9e..9b3769d94 100644 --- a/src/number-keyboard/Key.js +++ b/src/number-keyboard/Key.js @@ -39,7 +39,7 @@ export default createComponent({ this.active = true; }, - onBlur(event) { + onBlur() { this.active = false; }, @@ -48,7 +48,7 @@ export default createComponent({ } }, - render(h) { + render() { const { onBlur } = this; return ( {this.slots()} diff --git a/src/row/index.js b/src/row/index.js index dac61a99d..a4cadc5b3 100644 --- a/src/row/index.js +++ b/src/row/index.js @@ -17,7 +17,7 @@ export default createComponent({ } }, - render(h) { + render() { const { align, justify } = this; const flex = this.type === 'flex'; const margin = `-${Number(this.gutter) / 2}px`; diff --git a/src/sidebar-item/index.js b/src/sidebar-item/index.js index 3f87edd48..6d310e4fd 100644 --- a/src/sidebar-item/index.js +++ b/src/sidebar-item/index.js @@ -29,7 +29,7 @@ export default createComponent({ } }, - render(h) { + render() { return ( {this.slots()}
; } }); diff --git a/src/sku/Sku.js b/src/sku/Sku.js index a68ffb999..325fa437b 100644 --- a/src/sku/Sku.js +++ b/src/sku/Sku.js @@ -427,7 +427,7 @@ export default createComponent({ } }, - render(h) { + render() { if (this.isSkuEmpty) { return; } diff --git a/src/sku/components/SkuImgUploader.js b/src/sku/components/SkuImgUploader.js index 4034b4698..c73d3081a 100644 --- a/src/sku/components/SkuImgUploader.js +++ b/src/sku/components/SkuImgUploader.js @@ -77,7 +77,7 @@ export default createComponent({ } }, - render(h) { + render() { return (
{this.value && this.renderUploader( diff --git a/src/sku/components/SkuMessages.js b/src/sku/components/SkuMessages.js index c1e22173d..356d55905 100644 --- a/src/sku/components/SkuMessages.js +++ b/src/sku/components/SkuMessages.js @@ -121,7 +121,7 @@ export default createComponent({ } }, - render(h) { + render() { return ( {this.messages.map((message, index) => (message.type === 'image' ? ( diff --git a/src/sku/components/SkuRowItem.js b/src/sku/components/SkuRowItem.js index 6b464568e..885322e14 100644 --- a/src/sku/components/SkuRowItem.js +++ b/src/sku/components/SkuRowItem.js @@ -35,7 +35,7 @@ export default createComponent({ } }, - render(h) { + render() { const choosed = this.skuValue.id === this.selectedSku[this.skuKeyStr]; const imgUrl = this.skuValue.imgUrl || this.skuValue.img_url; diff --git a/src/sku/components/SkuStepper.js b/src/sku/components/SkuStepper.js index e2f1cbef8..72a6639c1 100644 --- a/src/sku/components/SkuStepper.js +++ b/src/sku/components/SkuStepper.js @@ -84,7 +84,7 @@ export default createComponent({ } }, - render(h) { + render() { return (
diff --git a/src/slider/index.js b/src/slider/index.js index 9eeab2a47..3ca4bdb43 100644 --- a/src/slider/index.js +++ b/src/slider/index.js @@ -115,7 +115,7 @@ export default createComponent({ } }, - render(h) { + render() { const { vertical } = this; const style = { background: this.inactiveColor diff --git a/src/step/index.js b/src/step/index.js index a7eb29311..3b6505d6e 100644 --- a/src/step/index.js +++ b/src/step/index.js @@ -31,7 +31,7 @@ export default createComponent({ } }, - render(h) { + render() { const { slots, status } = this; const { activeIcon, activeColor, inactiveIcon, direction } = this.$parent; const titleStyle = status === 'process' && { color: activeColor }; diff --git a/src/stepper/index.js b/src/stepper/index.js index f9c7939c6..74f150deb 100644 --- a/src/stepper/index.js +++ b/src/stepper/index.js @@ -165,7 +165,7 @@ export default createComponent({ }, LONG_PRESS_INTERVAL); }, - onTouchStart(type) { + onTouchStart() { clearTimeout(this.longPressTimer); this.isLongPress = false; @@ -185,7 +185,7 @@ export default createComponent({ } }, - render(h) { + render() { const createListeners = type => ({ on: { click: () => { diff --git a/src/steps/index.js b/src/steps/index.js index 6d1c009f6..1946d59d0 100644 --- a/src/steps/index.js +++ b/src/steps/index.js @@ -30,7 +30,7 @@ export default createComponent({ }; }, - render(h) { + render() { return (
{this.slots()}
diff --git a/src/sticky/index.js b/src/sticky/index.js index 8fe2b7d97..2e1112b76 100644 --- a/src/sticky/index.js +++ b/src/sticky/index.js @@ -102,7 +102,7 @@ export default createComponent({ } }, - render(h) { + render() { const { fixed } = this; const style = { height: fixed ? `${this.height}px` : null diff --git a/src/swipe-cell/demo/index.vue b/src/swipe-cell/demo/index.vue index 714307940..61647da77 100644 --- a/src/swipe-cell/demo/index.vue +++ b/src/swipe-cell/demo/index.vue @@ -82,7 +82,7 @@ export default { }, methods: { - onClose(clickPosition, instance, detail) { + onClose(clickPosition, instance) { switch (clickPosition) { case 'left': case 'cell': diff --git a/src/swipe-cell/index.js b/src/swipe-cell/index.js index 0bc9b2c0e..a22487dd2 100644 --- a/src/swipe-cell/index.js +++ b/src/swipe-cell/index.js @@ -153,7 +153,7 @@ export default createComponent({ } }, - render(h) { + render() { const onClick = (position, stop) => event => { if (stop) { event.stopPropagation(); diff --git a/src/swipe-item/index.js b/src/swipe-item/index.js index 30a3582aa..89c86144f 100644 --- a/src/swipe-item/index.js +++ b/src/swipe-item/index.js @@ -17,7 +17,7 @@ export default createComponent({ this.$parent.swipes.splice(this.$parent.swipes.indexOf(this), 1); }, - render(h) { + render() { const { vertical, computedWidth, computedHeight } = this.$parent; const style = { diff --git a/src/swipe/index.js b/src/swipe/index.js index 3fc26b17f..762137504 100644 --- a/src/swipe/index.js +++ b/src/swipe/index.js @@ -328,7 +328,7 @@ export default createComponent({ } }, - render(h) { + render() { return (