[improvement] update lint rules (#3970)
This commit is contained in:
@@ -61,7 +61,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<Cell class={bem()}>
|
||||
<Field
|
||||
|
||||
@@ -225,7 +225,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { data, errorInfo, searchResult } = this;
|
||||
const onFocus = name => () => this.onFocus(name);
|
||||
|
||||
|
||||
+1
-1
@@ -183,7 +183,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const on = {
|
||||
...this.$listeners,
|
||||
change: this.onChange
|
||||
|
||||
@@ -21,7 +21,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return <div class={bem()}>{this.slots()}</div>;
|
||||
}
|
||||
});
|
||||
|
||||
+1
-1
@@ -112,7 +112,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem()} style={this.style}>
|
||||
<svg viewBox="0 0 1060 1060">
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { span, offset } = this;
|
||||
return (
|
||||
<this.tag class={bem({ [span]: span, [`offset-${offset}`]: offset })} style={this.style}>
|
||||
|
||||
@@ -107,7 +107,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { disabled, expanded } = this;
|
||||
|
||||
const titleSlots = CELL_SLOTS.reduce((slots, name) => {
|
||||
|
||||
@@ -27,7 +27,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={[bem(), { 'van-hairline--top-bottom': this.border }]}>
|
||||
{this.slots()}
|
||||
|
||||
@@ -88,7 +88,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { data, errorInfo } = this;
|
||||
const onFocus = name => () => this.onFocus(name);
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem()}>
|
||||
{this.slots('default', this.timeData) || this.formattedTime}
|
||||
|
||||
@@ -85,7 +85,7 @@ test('start method', async () => {
|
||||
wrapper.vm.start();
|
||||
wrapper.vm.start();
|
||||
|
||||
await later(20);
|
||||
await later(50);
|
||||
|
||||
const laterShapShot = wrapper.html();
|
||||
|
||||
|
||||
@@ -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')} (${
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { coupon, disabled } = this;
|
||||
const description = (disabled && coupon.reason) || coupon.description;
|
||||
|
||||
|
||||
@@ -313,7 +313,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const props = {};
|
||||
Object.keys(pickerProps).forEach(key => {
|
||||
props[key] = this[key];
|
||||
|
||||
@@ -73,7 +73,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
if (!this.shouldRender) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ export default createComponent({
|
||||
this.onOpened = createEmitter('opened');
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const {
|
||||
zIndex,
|
||||
offset,
|
||||
|
||||
@@ -76,7 +76,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const Titles = this.children.map((item, index) => (
|
||||
<div
|
||||
role="button"
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { slots, labelAlign } = this;
|
||||
|
||||
const scopedSlots = {
|
||||
|
||||
@@ -35,7 +35,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<Button
|
||||
class={bem([
|
||||
|
||||
@@ -23,7 +23,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div role="button" tabindex="0" class={bem()} onClick={this.onClick}>
|
||||
{this.slots('icon') ? (
|
||||
|
||||
@@ -10,7 +10,7 @@ export default createComponent({
|
||||
safeAreaInsetBottom: Boolean
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem({ 'safe-area-inset-bottom': this.safeAreaInsetBottom })}>
|
||||
{this.slots()}
|
||||
|
||||
@@ -72,7 +72,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { center, border, square, gutter, clickable } = this.parent;
|
||||
|
||||
return (
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
style={this.style}
|
||||
|
||||
@@ -254,7 +254,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
if (!this.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
+1
-1
@@ -141,7 +141,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem({ round: this.round })} style={this.style} onClick={this.onClick}>
|
||||
{this.renderImage()}
|
||||
|
||||
@@ -43,7 +43,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { sticky } = this;
|
||||
|
||||
return (
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const Placeholder = <div ref="placeholder" class={bem('placeholder')}/>;
|
||||
|
||||
return (
|
||||
|
||||
@@ -46,7 +46,7 @@ export const CheckboxMixin = ({ parent, bem, role }) => ({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { slots, checked } = this;
|
||||
|
||||
const CheckIcon = slots('icon', { checked }) || (
|
||||
|
||||
@@ -76,7 +76,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { slots, mode, leftIcon, onClickIcon } = this;
|
||||
|
||||
const barStyle = {
|
||||
|
||||
@@ -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 (
|
||||
<i
|
||||
|
||||
@@ -129,7 +129,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { title, theme, onPress, closeButtonText } = this;
|
||||
|
||||
const titleLeftSlot = this.slots('title-left');
|
||||
|
||||
@@ -114,7 +114,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { value } = this;
|
||||
const simple = this.mode !== 'multi';
|
||||
|
||||
|
||||
@@ -219,7 +219,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { itemHeight, visibleItemCount } = this;
|
||||
|
||||
const baseOffset = (itemHeight * (visibleItemCount - 1)) / 2;
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ export default createComponent({
|
||||
this.onClosed = createEmitter('closed');
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
if (!this.shouldRender) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { pivotText, percentage } = this;
|
||||
const text = isDef(pivotText) ? pivotText : percentage + '%';
|
||||
const showPivot = this.showPivot && text;
|
||||
|
||||
@@ -147,7 +147,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { status, distance } = this;
|
||||
const text = this[`${status}Text`] || t(status);
|
||||
const style = {
|
||||
|
||||
@@ -17,7 +17,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem()} role="radiogroup">
|
||||
{this.slots()}
|
||||
|
||||
+1
-1
@@ -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`;
|
||||
|
||||
@@ -29,7 +29,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<a
|
||||
class={[bem({ select: this.select }), 'van-hairline']}
|
||||
|
||||
@@ -17,7 +17,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return <div class={[bem(), 'van-hairline--top-bottom']}>{this.slots()}</div>;
|
||||
}
|
||||
});
|
||||
|
||||
+1
-1
@@ -427,7 +427,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
if (this.isSkuEmpty) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem()}>
|
||||
{this.value && this.renderUploader(
|
||||
|
||||
@@ -121,7 +121,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<CellGroup class={bem()}>
|
||||
{this.messages.map((message, index) => (message.type === 'image' ? (
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class="van-sku-stepper-stock">
|
||||
<div class="van-sku-stepper-container">
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { vertical } = this;
|
||||
const style = {
|
||||
background: this.inactiveColor
|
||||
|
||||
+1
-1
@@ -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 };
|
||||
|
||||
@@ -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: () => {
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ export default createComponent({
|
||||
};
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem([this.direction])}>
|
||||
<div class={bem('items')}>{this.slots()}</div>
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { fixed } = this;
|
||||
const style = {
|
||||
height: fixed ? `${this.height}px` : null
|
||||
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
onClose(clickPosition, instance, detail) {
|
||||
onClose(clickPosition, instance) {
|
||||
switch (clickPosition) {
|
||||
case 'left':
|
||||
case 'cell':
|
||||
|
||||
@@ -153,7 +153,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const onClick = (position, stop) => event => {
|
||||
if (stop) {
|
||||
event.stopPropagation();
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
+1
-1
@@ -328,7 +328,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem()}>
|
||||
<div
|
||||
|
||||
@@ -41,7 +41,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { icon, slots } = this;
|
||||
const active = this.parent.route ? this.routeActive : this.active;
|
||||
const color = this.parent[active ? 'activeColor' : 'inactiveColor'];
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
style={{ zIndex: this.zIndex }}
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
class={bem('content', { animated: this.animated })}
|
||||
|
||||
+1
-1
@@ -60,7 +60,7 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div
|
||||
role="tab"
|
||||
|
||||
+1
-1
@@ -251,7 +251,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { type, ellipsis, animated, scrollable } = this;
|
||||
|
||||
const Nav = this.children.map((item, index) => (
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
const { type, icon, message, iconPrefix, loadingType } = this;
|
||||
|
||||
const hasIcon = icon || (type === 'success' || type === 'fail');
|
||||
|
||||
@@ -248,7 +248,7 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
render() {
|
||||
return (
|
||||
<div class={bem()}>
|
||||
<div class={bem('wrapper')}>
|
||||
|
||||
Reference in New Issue
Block a user