chore: enhance eslint (#1890)

* perf: enhance eslint

* perf: remove props in progress
pull/1938/head
Amour1688 2020-03-18 14:52:02 +08:00 committed by GitHub
parent e654713290
commit 615b460ee4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
74 changed files with 104 additions and 163 deletions

View File

@ -15,6 +15,10 @@
"rules": {
"comma-dangle": [2, "always-multiline"],
"no-var": "error",
"no-console": [2, { "allow": ["warn", "error"] }],
"object-shorthand": 2,
"no-unused-vars": [2, { "ignoreRestSiblings": true, "argsIgnorePattern": "^h$" }],
"no-undef": 2,
"camelcase": "off",
"no-extra-boolean-cast": "off",
"semi": ["error", "always"],
@ -32,5 +36,8 @@
}
}
]
},
"globals": {
"h": true
}
}

View File

@ -52,7 +52,7 @@ export default {
}
if (!this._component) {
this._component = new this.$root.constructor({
el: el,
el,
parent: self,
data: {
comProps: props,

View File

@ -1,3 +1,4 @@
/* eslint-disable no-undef */
// Browser environment sniffing
export const inBrowser = typeof window !== 'undefined';
export const inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;

View File

@ -2,7 +2,6 @@ import Affix from '..';
import Button from '../../button';
import { mount } from '@vue/test-utils';
import { spyElementPrototype } from '../../__tests__/util/domHook';
import { asyncExpect } from '@/tests/utils';
const events = {};
const AffixMounter = {
@ -62,7 +61,7 @@ describe('Affix Render', () => {
});
const movePlaceholder = top => {
classRect.fixed = {
top: top,
top,
bottom: top,
};
events.scroll({

View File

@ -1,6 +1,5 @@
import PropTypes from '../_util/vue-types';
import classNames from 'classnames';
import shallowequal from 'shallowequal';
import omit from 'omit.js';
import ResizeObserver from '../vc-resize-observer';
import BaseMixin from '../_util/BaseMixin';
@ -231,7 +230,7 @@ const Affix = {
},
render() {
const { prefixCls, affixStyle, placeholderStyle, status, $slots, $props } = this;
const { prefixCls, affixStyle, placeholderStyle, $slots, $props } = this;
const getPrefixCls = this.configProvider.getPrefixCls;
const className = classNames({
[getPrefixCls('affix', prefixCls)]: affixStyle,

View File

@ -61,7 +61,7 @@ export default {
return originalPaths;
},
genForRoutes({ routes = [], params = {}, separator, itemRender = defaultItemRender }) {
genForRoutes({ routes = [], params = {}, separator, itemRender = this.defaultItemRender }) {
const paths = [];
return routes.map(route => {
const path = this.getPath(route.path, params);

View File

@ -26,7 +26,7 @@ export default {
};
},
render() {
const { prefixCls: customizePrefixCls, size, sizeMap, $slots } = this;
const { prefixCls: customizePrefixCls, size, $slots } = this;
const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('btn-group', customizePrefixCls);

View File

@ -36,7 +36,6 @@ export default {
sLoading,
ghost,
block,
sizeMap,
icon,
$slots,
} = this;

View File

@ -1,7 +1,7 @@
import Select from '../select';
import { Group, Button } from '../radio';
import PropTypes from '../_util/vue-types';
import { initDefaultProps, getComponentFromProp } from '../_util/props-util';
import { initDefaultProps } from '../_util/props-util';
import { ConfigConsumerProps } from '../config-provider';
const { Option } = Select;

View File

@ -22,7 +22,7 @@ function zerofixed(v) {
}
export const MomentType = {
type: Object,
validator: function(value) {
validator(value) {
return moment.isMoment(value);
},
};
@ -207,11 +207,11 @@ const Calendar = {
Select: {},
locale: locale.lang,
type: mode === 'year' ? 'month' : 'date',
prefixCls: prefixCls,
prefixCls,
showHeader: false,
value: value,
monthCellRender: monthCellRender,
dateCellRender: dateCellRender,
value,
monthCellRender,
dateCellRender,
disabledDate,
},
on: {

View File

@ -3,8 +3,6 @@ import Card from '../index';
import Button from '../../button/index';
import mountTest from '../../../tests/shared/mountTest';
const testMethod = typeof window !== 'undefined' ? it : xit;
describe('Card', () => {
mountTest(Card);
beforeAll(() => {

View File

@ -484,7 +484,7 @@ const Cascader = {
prefixCls: inputPrefixCls,
placeholder: value && value.length > 0 ? undefined : placeholder,
value: inputValue,
disabled: disabled,
disabled,
readOnly: !showSearch,
autoComplete: 'off',
},
@ -535,11 +535,11 @@ const Cascader = {
props: {
...props,
getPopupContainer,
options: options,
options,
prefixCls,
value: value,
value,
popupVisible: sPopupVisible,
dropdownMenuColumnStyle: dropdownMenuColumnStyle,
dropdownMenuColumnStyle,
expandIcon,
loadingIcon,
},

View File

@ -1,5 +1,5 @@
import PropsTypes from '../_util/vue-types';
import { initDefaultProps, getComponentFromProp, getListeners } from '../_util/props-util';
import { getComponentFromProp, getListeners } from '../_util/props-util';
import { ConfigConsumerProps } from '../config-provider';
import Base from '../base';
export const CommentProps = {

View File

@ -14,11 +14,9 @@ import {
initDefaultProps,
mergeProps,
getComponentFromProp,
isValidElement,
getListeners,
} from '../_util/props-util';
import BaseMixin from '../_util/BaseMixin';
import { cloneElement } from '../_util/vnode';
import { formatDate } from './utils';
import InputIcon from './InputIcon';
@ -221,7 +219,7 @@ export default {
this.$refs.picker.blur();
},
renderFooter(...args) {
renderFooter() {
const { ranges, $scopedSlots, $slots } = this;
const { _prefixCls: prefixCls, _tagPrefixCls: tagPrefixCls } = this;
const renderExtraFooter =
@ -341,22 +339,22 @@ export default {
const rangeCalendarProps = mergeProps(calendarProps, {
props: {
separator,
format: format,
prefixCls: prefixCls,
format,
prefixCls,
renderFooter: this.renderFooter,
timePicker: props.timePicker,
disabledDate: disabledDate,
disabledTime: disabledTime,
disabledDate,
disabledTime,
dateInputPlaceholder: [startPlaceholder, endPlaceholder],
locale: locale.lang,
dateRender: dateRender,
dateRender,
value: showDate,
hoverValue: hoverValue,
showToday: showToday,
hoverValue,
showToday,
},
on: {
change: calendarChange,
ok: ok,
ok,
valueChange: this.handleShowDateChange,
hoverChange: this.handleHoverChange,
panelChange,
@ -419,9 +417,9 @@ export default {
pickerChangeHandler,
{
props: {
calendar: calendar,
value: value,
open: open,
calendar,
value,
open,
prefixCls: `${prefixCls}-picker-container`,
},
on: {

View File

@ -8,13 +8,11 @@ import {
getOptionProps,
initDefaultProps,
getComponentFromProp,
isValidElement,
getListeners,
} from '../_util/props-util';
import BaseMixin from '../_util/BaseMixin';
import { WeekPickerProps } from './interface';
import interopDefault from '../_util/interopDefault';
import { cloneElement } from '../_util/vnode';
import InputIcon from './InputIcon';
function formatValue(value, format) {

View File

@ -191,7 +191,7 @@ export default function createPicker(TheCalendar, props) {
value: showDate,
},
on: {
ok: ok,
ok,
panelChange,
change: this.handleCalendarChange,
},

View File

@ -4,7 +4,7 @@ import PropTypes from '../_util/vue-types';
export const MomentType = {
type: Object,
validator: function(value) {
validator(value) {
return value === undefined || moment.isMoment(value);
},
};

View File

@ -133,7 +133,7 @@ const Form = {
colon: true,
}),
Item: FormItem,
createFormField: createFormField,
createFormField,
create: (options = {}) => {
return createDOMForm({
fieldNameProp: 'id',
@ -246,7 +246,7 @@ const Form = {
data() {
return {
children: $slots.default,
formClassName: formClassName,
formClassName,
submit: onSubmit,
};
},

View File

@ -238,7 +238,7 @@ export default {
// Resolve duplicated ids bug between different forms
// https://github.com/ant-design/ant-design/issues/7351
onLabelClick(e) {
onLabelClick() {
const id = this.id || this.getId();
if (!id) {
return;

View File

@ -3,15 +3,6 @@ import BaseMixin from '../_util/BaseMixin';
import { ConfigConsumerProps } from '../config-provider';
import ResponsiveObserve from '../_util/responsiveObserve';
const BreakpointMap = PropTypes.shape({
xs: PropTypes.number,
sm: PropTypes.number,
md: PropTypes.number,
lg: PropTypes.number,
xl: PropTypes.number,
xxl: PropTypes.number,
}).loose;
const RowProps = {
gutter: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]),
type: PropTypes.oneOf(['flex']),

View File

@ -1,8 +1,6 @@
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Layout from '..';
import Icon from '../../icon';
import Menu from '../../menu';
import mountTest from '../../../tests/shared/mountTest';
const { Sider, Content } = Layout;

View File

@ -1,7 +1,6 @@
import PropTypes from '../_util/vue-types';
import classNames from 'classnames';
import {
getSlotOptions,
getComponentFromProp,
isStringElement,
getListeners,

View File

@ -1,7 +1,6 @@
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Mentions from '..';
import { asyncExpect } from '@/tests/utils';
import focusTest from '../../../tests/shared/focusTest';
const { getMentions } = Mentions;

View File

@ -160,7 +160,7 @@ const Mentions = {
...otherProps,
disabled,
filterOption: this.getFilterOption(),
getPopupContainer: getPopupContainer,
getPopupContainer,
children: this.getOptions(),
},
class: mergedClassName,

View File

@ -132,7 +132,7 @@ describe('Menu', () => {
props: {
openKeys: {
type: Array,
default: function() {
default() {
return ['1'];
},
},
@ -171,7 +171,7 @@ describe('Menu', () => {
props: {
openKeys: {
type: Array,
default: function() {
default() {
return ['1'];
},
},
@ -209,7 +209,7 @@ describe('Menu', () => {
props: {
openKeys: {
type: Array,
default: function() {
default() {
return ['1'];
},
},

View File

@ -79,7 +79,7 @@ const Menu = {
inlineCollapsed(val) {
this.collapsedChange(val);
},
'layoutSiderContext.sCollapsed': function(val) {
'layoutSiderContext.sCollapsed'(val) {
this.collapsedChange(val);
},
},

View File

@ -199,7 +199,7 @@ export default {
wrapClassName: classNames({ [`${prefixCls}-centered`]: !!centered }, wrapClassName),
title,
footer: footer === undefined ? defaultFooter : footer,
visible: visible,
visible,
mousePosition,
closeIcon: closeIconToRender,
},

View File

@ -1,5 +1,4 @@
import { mount } from '@vue/test-utils';
import Vue from 'vue';
import Modal from '..';
import mountTest from '../../../tests/shared/mountTest';

View File

@ -46,7 +46,7 @@ export default function confirm(config) {
confirmDialogProps.props = props;
const V = Base.Vue || Vue;
return new V({
el: el,
el,
parent: config.parentContext,
data() {
return { confirmDialogProps };

View File

@ -22,6 +22,7 @@ export const PageHeaderProps = {
};
const renderBack = (instance, prefixCls, backIcon, onBack) => {
// eslint-disable-next-line no-unused-vars
const h = instance.$createElement;
if (!backIcon || !onBack) {
return null;

View File

@ -7,10 +7,6 @@ import Line from './line';
import Circle from './circle';
import { validProgress } from './utils';
function addUnit(num, unit) {
const unitType = unit || 'px';
return num ? num + unitType : null;
}
const ProgressStatuses = ['normal', 'exception', 'active', 'success'];
export const ProgressType = PropTypes.oneOf(['line', 'circle', 'dashboard']);
export const ProgressSize = PropTypes.oneOf(['default', 'small']);
@ -91,24 +87,7 @@ export default {
},
render() {
const props = getOptionProps(this);
const {
prefixCls: customizePrefixCls,
percent = 0,
status,
format,
trailColor,
size,
successPercent,
type,
strokeWidth,
width,
showInfo,
gapDegree = 0,
gapPosition,
strokeColor,
strokeLinecap = 'round',
...restProps
} = props;
const { prefixCls: customizePrefixCls, size, type, showInfo } = props;
const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('progress', customizePrefixCls);
const progressStatus = this.getProgressStatus();
@ -144,9 +123,6 @@ export default {
});
const progressProps = {
props: {
...restProps,
},
on: getListeners(this),
class: classString,
};

View File

@ -100,7 +100,7 @@ export default {
// options, 使
if (options && options.length > 0) {
children = options.map((option, index) => {
children = options.map(option => {
if (typeof option === 'string') {
return (
<Radio

View File

@ -2,7 +2,6 @@ import { mount } from '@vue/test-utils';
import { asyncExpect } from '@/tests/utils';
import Radio from '../Radio';
import RadioGroup from '../Group';
import RadioButton from '../RadioButton';
describe('Radio', () => {
function createRadioGroup(props, listeners = {}) {

View File

@ -1,5 +1,5 @@
import PropTypes from '../_util/vue-types';
import { getOptionProps, getComponentFromProp } from '../_util/props-util';
import { getComponentFromProp } from '../_util/props-util';
import { ConfigConsumerProps } from '../config-provider';
import Icon from '../icon';
import Base from '../base';
@ -57,7 +57,7 @@ const Result = {
configProvider: { default: () => ConfigConsumerProps },
},
render(h) {
const { prefixCls: customizePrefixCls, status, ...restProps } = this;
const { prefixCls: customizePrefixCls, status } = this;
const getPrefixCls = this.configProvider.getPrefixCls;
const prefixCls = getPrefixCls('result', customizePrefixCls);

View File

@ -1,5 +1,4 @@
import PropTypes from '../_util/vue-types';
import { initDefaultProps } from '../_util/props-util';
const widthUnit = PropTypes.oneOfType([PropTypes.number, PropTypes.string]);

View File

@ -1,10 +1,8 @@
import { mount } from '@vue/test-utils';
import { asyncExpect } from '@/tests/utils';
import MockDate from 'mockdate';
import moment from 'moment';
import Statistic from '..';
import { formatTimeStr } from '../utils';
import { sleep } from '../../../tests/utils';
import mountTest from '../../../tests/shared/mountTest';
describe('Statistic', () => {

View File

@ -114,7 +114,7 @@ export default {
watch: {
$props: {
handler: function() {
handler() {
this.setCheckState(this.$props);
},
deep: true,

View File

@ -60,8 +60,6 @@ const defaultPagination = {
onShowSizeChange: noop,
};
const ROW_SELECTION_COLUMN_WIDTH = '62px';
/**
* Avoid creating new object, so that parent component's shouldComponentUpdate
* can works appropriately
@ -1050,7 +1048,6 @@ export default {
let filterDropdown;
let sortButton;
let customHeaderCell = column.customHeaderCell;
const title = this.renderColumnTitle(column.title);
const isSortColumn = this.isSortColumn(column);
if ((column.filters && column.filters.length > 0) || column.filterDropdown) {
const colFilters = key in filters ? filters[key] : [];

View File

@ -69,7 +69,7 @@ describe('SelectionBox', () => {
const store = getDefaultStore();
const wrapper = mount(SelectionBox, {
propsData: {
store: store,
store,
rowIndex: '1',
disabled: false,
defaultSelection: [],

View File

@ -592,7 +592,7 @@ describe('Table.rowSelection', () => {
propsData: {
columns: filterColumns,
dataSource: data,
rowSelection: rowSelection,
rowSelection,
},
sync: false,
});
@ -692,7 +692,7 @@ describe('Table.rowSelection', () => {
const wrapper = mount(Table, {
propsData: {
columns: columns,
columns,
dataSource: newDatas,
rowSelection: {},
childrenColumnName: 'test',

View File

@ -107,7 +107,7 @@ describe('Table', () => {
dataIndex: 'age',
key: 'age',
align: 'center',
customCell: (record, rowIndex) => {
customCell: () => {
return {
style: {
color: 'red',

View File

@ -107,7 +107,7 @@ export default {
display: 'inline-block', // default inline-block is important
...picked,
cursor: 'not-allowed',
width: isAntBtn && ele.componentOptions.propsData.block ? '100%' : null,
width: ele.componentOptions.propsData.block ? '100%' : null,
};
const buttonStyle = {
...omitted,

View File

@ -7,7 +7,6 @@ import {
getOptionProps,
filterEmpty,
getComponentFromProp,
getClass,
getListeners,
} from '../_util/props-util';
import { cloneElement } from '../_util/vnode';

View File

@ -19,7 +19,7 @@ export default {
name: 'AUpload',
mixins: [BaseMixin],
inheritAttrs: false,
Dragger: Dragger,
Dragger,
props: initDefaultProps(UploadProps, {
type: 'select',
multiple: false,

View File

@ -731,7 +731,7 @@ const RangeCalendar = {
mode: mode[0],
placeholder: placeholder1,
showDateInput: this.showDateInput,
timePicker: timePicker,
timePicker,
showTimePicker: sShowTimePicker || mode[0] === 'time',
enablePrev: true,
enableNext: !isClosestMonths || this.isMonthYearPanelShow(mode[1]),
@ -754,7 +754,7 @@ const RangeCalendar = {
value: endValue,
mode: mode[1],
showDateInput: this.showDateInput,
timePicker: timePicker,
timePicker,
showTimePicker: sShowTimePicker || mode[1] === 'time',
disabledTime: this.disabledEndTime,
disabledMonth: this.disabledEndMonth,

View File

@ -44,7 +44,7 @@ const CalendarFooter = {
const btnProps = {
props: {
...props,
value: value,
value,
},
on: getListeners(this),
};

View File

@ -363,9 +363,9 @@ export default {
const triggerProps = {
props: {
...restProps,
disabled: disabled,
popupPlacement: popupPlacement,
builtinPlacements: builtinPlacements,
disabled,
popupPlacement,
builtinPlacements,
popupTransitionName: transitionName,
action: disabled ? [] : ['click'],
popupVisible: disabled ? false : sPopupVisible,

View File

@ -1,6 +1,5 @@
import PanelContent from './PanelContent';
import { initDefaultProps, getComponentFromProp } from '../../_util/props-util';
import { cloneElement } from '../../_util/vnode';
import { panelProps } from './commonProps';
export default {

View File

@ -191,7 +191,7 @@ export default {
popupAnimation: animation,
popupVisible: this.sVisible,
afterPopupVisibleChange: this.afterVisibleChange,
getPopupContainer: getPopupContainer,
getPopupContainer,
},
on: {
popupVisibleChange: this.onVisibleChange,

View File

@ -96,7 +96,7 @@ function createBaseForm(option = {}, mixins = []) {
? {}
: {
$props: {
handler: function(nextProps) {
handler(nextProps) {
if (mapPropsToFields) {
this.fieldsStore.updateFields(mapPropsToFields(nextProps));
}

View File

@ -3,7 +3,6 @@ import PropTypes from '../../_util/vue-types';
import BaseMixin from '../../_util/BaseMixin';
import { initDefaultProps, hasProp, getOptionProps, getListeners } from '../../_util/props-util';
import classNames from 'classnames';
import isNegativeZero from 'is-negative-zero';
import KeyCode from '../../_util/KeyCode';
import InputHandler from './InputHandler';

View File

@ -65,7 +65,7 @@ const Menu = {
}
this.__emit('select', {
...selectInfo,
selectedKeys: selectedKeys,
selectedKeys,
});
}
},
@ -128,7 +128,7 @@ const Menu = {
}
this.__emit('deselect', {
...selectInfo,
selectedKeys: selectedKeys,
selectedKeys,
});
}
},

View File

@ -10,7 +10,6 @@ import { getComponentFromProp, filterEmpty, getListeners } from '../_util/props-
import { requestAnimationTimeout, cancelAnimationTimeout } from '../_util/requestAnimationTimeout';
import { noop, loopMenuItemRecursively, getMenuIdFromSubMenuEventKey } from './util';
import getTransitionProps from '../_util/getTransitionProps';
import { MenuItem } from './MenuItem';
let guid = 0;

View File

@ -38,7 +38,7 @@ export default {
goInputText: value,
});
},
handleBlur() {
handleBlur(e) {
const { goButton, quickGo, rootPrefixCls } = this.$props;
if (goButton) {
return;

View File

@ -181,7 +181,7 @@ const Select = {
__propsSymbol__() {
Object.assign(this.$data, this.getDerivedStateFromProps(getOptionProps(this), this.$data));
},
'$data._inputValue': function(val) {
'$data._inputValue'(val) {
this.$data._mirrorInputValue = val;
},
},
@ -417,7 +417,7 @@ const Select = {
// Aviod trigger form submit when select item
// https://github.com/ant-design/ant-design/issues/10861
// https://github.com/ant-design/ant-design/issues/14544
if (isRealOpen || !props.combobox) {
if (isRealOpen || !combobox) {
event.preventDefault();
}
// Hard close popup to avoid lock of non option in combobox mode
@ -1149,7 +1149,7 @@ const Select = {
},
renderFilterOptions() {
const { _inputValue: inputValue } = this.$data;
const { children, tags, filterOption, notFoundContent } = this.$props;
const { children, tags, notFoundContent } = this.$props;
const menuItems = [];
const childrenKeys = [];
let empty = false;
@ -1545,7 +1545,7 @@ const Select = {
return null;
},
selectionRefClick(e) {
selectionRefClick() {
//e.stopPropagation();
if (!this.disabled) {
const input = this.getInputDOMNode();

View File

@ -39,8 +39,8 @@ export const PrevArrow = {
},
};
const customProps = {
currentSlide: currentSlide,
slideCount: slideCount,
currentSlide,
slideCount,
};
let prevArrow;
@ -110,8 +110,8 @@ export const NextArrow = {
},
};
const customProps = {
currentSlide: currentSlide,
slideCount: slideCount,
currentSlide,
slideCount,
};
let nextArrow;

View File

@ -29,10 +29,10 @@ export default {
dotsClass,
} = props;
const dotCount = getDotCount({
slideCount: slideCount,
slidesToScroll: slidesToScroll,
slidesToShow: slidesToShow,
infinite: infinite,
slideCount,
slidesToScroll,
slidesToShow,
infinite,
});
// Apply join & split to Array to pre-fill it for IE8
@ -55,8 +55,8 @@ export default {
const dotOptions = {
message: 'dots',
index: i,
slidesToScroll: slidesToScroll,
currentSlide: currentSlide,
slidesToScroll,
currentSlide,
};
function onClick(e) {
// In Autoplay the focus stays on clicked button even after transition

View File

@ -161,7 +161,7 @@ export default {
};
this.setState({
slideWidth: slideWidth + '%',
trackStyle: trackStyle,
trackStyle,
});
},
checkImagesLoad() {

View File

@ -73,7 +73,7 @@ export default {
// when not using server side rendering
canUseDOM() &&
this.media(bQuery, () => {
this.setState({ breakpoint: breakpoint });
this.setState({ breakpoint });
});
});

View File

@ -88,7 +88,7 @@ const renderSlides = function(spec, children, createElement) {
let child;
const childOnClickOptions = {
message: 'children',
index: index,
index,
slidesToScroll: spec.slidesToScroll,
currentSlide: spec.currentSlide,
};

View File

@ -185,7 +185,7 @@ const Range = {
const value = trimAlignValue({
value: mutatedValue,
handle: sHandle,
bounds: bounds,
bounds,
props: this.$props,
});
if (value === oldValue) return;

View File

@ -110,7 +110,7 @@ const BaseTable = {
record,
index: i,
prefixCls: rowPrefixCls,
childrenColumnName: childrenColumnName,
childrenColumnName,
columns: leafColumns,
rowKey: key,
ancestorKeys,

View File

@ -72,7 +72,7 @@ export default {
class={cls}
key={key}
style={style}
{...{ directives: directives }}
{...{ directives }}
>
{tab}
</div>

View File

@ -57,7 +57,7 @@ export default {
},
},
render() {
const { activeKey, tabBarPosition, animated, animatedWithMargin, classes } = this;
const { activeKey, tabBarPosition, animated, animatedWithMargin, direction, classes } = this;
let style = {};
if (animated && this.$slots.default) {
const activeIndex = getActiveIndex(this.$slots.default, activeKey);

View File

@ -1,8 +1,6 @@
import PropTypes from '../_util/vue-types';
import BaseMixin from '../_util/BaseMixin';
import moment from 'moment';
import { getComponentFromProp } from '../_util/props-util';
import { isIE, isIE9 } from '../_util/env';
const Header = {
mixins: [BaseMixin],

View File

@ -129,7 +129,6 @@ const Panel = {
addon,
disabledSeconds,
hideDisabledOptions,
allowEmpty,
showHour,
showMinute,
showSecond,
@ -146,7 +145,7 @@ const Panel = {
currentSelectPanel,
} = this;
const clearIcon = getComponentFromProp(this, 'clearIcon');
const { esc = noop, clear = noop, keydown = noop } = getListeners(this);
const { esc = noop, keydown = noop } = getListeners(this);
const disabledHourOptions = this.disabledHours2();
const disabledMinuteOptions = disabledMinutes(sValue ? sValue.hour() : null);

View File

@ -5,11 +5,6 @@ import raf from 'raf';
function noop() {}
const scrollTo = (element, to, duration) => {
const requestAnimationFrame =
window.requestAnimationFrame ||
function requestAnimationFrameTimeout() {
return setTimeout(arguments[0], 10);
};
// jump to target if duration zero
if (duration <= 0) {
raf(() => {

View File

@ -192,7 +192,6 @@ export default {
disabledSeconds,
hideDisabledOptions,
inputReadOnly,
allowEmpty,
showHour,
showMinute,
showSecond,

View File

@ -73,7 +73,7 @@ export default {
const triggerProps = {
props: {
popupClassName: overlayClassName,
prefixCls: prefixCls,
prefixCls,
action: trigger,
builtinPlacements: placements,
popupPlacement: placement,
@ -84,9 +84,9 @@ export default {
popupAnimation: animation,
defaultPopupVisible: defaultVisible,
destroyPopupOnHide: destroyTooltipOnHide,
mouseLeaveDelay: mouseLeaveDelay,
mouseLeaveDelay,
popupStyle: overlayStyle,
mouseEnterDelay: mouseEnterDelay,
mouseEnterDelay,
...extraProps,
},
on: {

View File

@ -255,12 +255,12 @@ const BasePopup = {
selectable: !treeCheckable,
checkable: treeCheckable,
checkStrictly: treeCheckStrictly,
multiple: multiple,
loadData: loadData,
loadedKeys: loadedKeys,
multiple,
loadData,
loadedKeys,
expandedKeys: expandedKeyList,
filterTreeNode: this.filterTreeNode,
switcherIcon: switcherIcon,
switcherIcon,
...treeProps,
__propsSymbol__: Symbol(),
children: $treeNodes,

View File

@ -219,12 +219,12 @@ const Select = {
this.setState(state);
this.needSyncKeys = {};
},
'$data._valueList': function() {
'$data._valueList'() {
this.$nextTick(() => {
this.forcePopupAlign();
});
},
'$data._open': function() {
'$data._open'() {
this.$nextTick(() => {
const { prefixCls } = this.$props;
const { _selectorValueList: selectorValueList, _valueEntities: valueEntities } = this.$data;

View File

@ -350,7 +350,7 @@ function processProps(props) {
props: omit(props, ['on', 'key', 'class', 'className', 'style']),
on,
class: cls || props.className,
style: style,
style,
key,
};
// Warning user not to use deprecated label prop.

View File

@ -4,7 +4,6 @@ import { getNodeChildren, mapChildren, warnOnlyTreeNode } from './util';
import { initDefaultProps, filterEmpty, getComponentFromProp } from '../../_util/props-util';
import BaseMixin from '../../_util/BaseMixin';
import getTransitionProps from '../../_util/getTransitionProps';
import { cloneElement } from '../../_util/vnode';
function noop() {}
const ICON_OPEN = 'open';

View File

@ -112,7 +112,7 @@ export default {
this.prevPopupVisible = val;
}
},
sPopupVisible(val) {
sPopupVisible() {
this.$nextTick(() => {
this.renderComponent(null, () => {
this.afterPopupVisibleChange(this.sPopupVisible);