Skip to content

Commit 19d5e7a

Browse files
committed
fix: lint error
1 parent b155627 commit 19d5e7a

File tree

6 files changed

+41
-45
lines changed

6 files changed

+41
-45
lines changed

components/_util/transition.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ if (process.env.NODE_ENV === 'test') {
6767
inheritAttrs: false,
6868
props: ['tag', 'class'],
6969
setup(props, { slots }) {
70-
const { tag: Tag, ...rest } = props;
7170
return () => {
71+
const { tag: Tag, ...rest } = props;
7272
const children = slots.default?.() || [];
7373
if (Tag) {
7474
return <Tag {...rest}>{children}</Tag>;

components/form/FormItem.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -250,22 +250,6 @@ export default defineComponent({
250250

251251
return promise;
252252
},
253-
getRules() {
254-
let formRules = this.FormContext.rules;
255-
const selfRules = this.rules;
256-
const requiredRule =
257-
this.required !== undefined
258-
? { required: !!this.required, trigger: this.mergedValidateTrigger }
259-
: [];
260-
const prop = getPropByPath(formRules, this.namePath);
261-
formRules = formRules ? prop.o[prop.k] || prop.v : [];
262-
const rules = [].concat(selfRules || formRules || []);
263-
if (find(rules, rule => rule.required)) {
264-
return rules;
265-
} else {
266-
return rules.concat(requiredRule);
267-
}
268-
},
269253
onFieldBlur() {
270254
this.validateRules({ triggerName: 'blur' });
271255
},

components/grid/Row.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const ARow = defineComponent<RowProps>({
4747

4848
onMounted(() => {
4949
token = ResponsiveObserve.subscribe(screen => {
50-
const currentGutter = gutterRef.value || 0;
50+
const currentGutter = props.gutter || 0;
5151
if (
5252
(!Array.isArray(currentGutter) && typeof currentGutter === 'object') ||
5353
(Array.isArray(currentGutter) &&
@@ -70,8 +70,6 @@ const ARow = defineComponent<RowProps>({
7070
xl: true,
7171
xxl: true,
7272
});
73-
const gutterRef = ref<Gutter | [Gutter, Gutter]>();
74-
gutterRef.value = props.gutter;
7573

7674
const { getPrefixCls } = inject('configProvider', defaultConfigProvider);
7775

components/table/filterDropdown.tsx

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { watchEffect, reactive, defineComponent, nextTick } from 'vue';
1+
import { reactive, defineComponent, nextTick, computed, watch } from 'vue';
22
import FilterFilled from '@ant-design/icons-vue/FilterFilled';
33
import Menu, { SubMenu, Item as MenuItem } from '../vc-menu';
44
import closest from 'dom-closest';
@@ -27,32 +27,44 @@ export default defineComponent({
2727
props: initDefaultProps(FilterMenuProps, {
2828
column: {},
2929
}),
30-
setup(nextProps) {
31-
let preProps = { ...nextProps };
32-
const { selectedKeys, column } = nextProps;
30+
setup(props) {
31+
const sSelectedKeys = computed(() => props.selectedKeys);
32+
const sVisible = computed(() => {
33+
return 'filterDropdownVisible' in props.column ? props.column.filterDropdownVisible : false;
34+
});
35+
const sValueKeys = computed(() => generateValueMaps(props.column.filters));
3336
const state = reactive({
3437
neverShown: false,
35-
sSelectedKeys: selectedKeys,
38+
sSelectedKeys: sSelectedKeys.value,
3639
sKeyPathOfSelectedItem: {}, // 记录所有有选中子菜单的祖先菜单
37-
sVisible: 'filterDropdownVisible' in column ? column.filterDropdownVisible : false,
38-
sValueKeys: generateValueMaps(column.filters),
40+
sVisible: sVisible.value,
41+
sValueKeys: sValueKeys.value,
3942
});
40-
watchEffect(
41-
() => {
42-
const { column } = nextProps;
43-
if (!shallowequal(preProps.selectedKeys, nextProps.selectedKeys)) {
44-
state.sSelectedKeys = nextProps.selectedKeys;
45-
}
46-
if (!shallowequal((preProps.column || {}).filters, (nextProps.column || {}).filters)) {
47-
state.sValueKeys = generateValueMaps(nextProps.column.filters);
48-
}
49-
if ('filterDropdownVisible' in column) {
50-
state.sVisible = column.filterDropdownVisible;
51-
}
52-
preProps = { ...nextProps };
53-
},
54-
{ flush: 'sync' },
55-
);
43+
watch(sSelectedKeys, () => {
44+
state.sSelectedKeys = sSelectedKeys.value;
45+
});
46+
watch(sVisible, () => {
47+
state.sVisible = sVisible.value;
48+
});
49+
watch(sValueKeys, () => {
50+
state.sValueKeys = sValueKeys.value;
51+
});
52+
// watchEffect(
53+
// () => {
54+
// const { column } = nextProps;
55+
// if (!shallowequal(preProps.selectedKeys, nextProps.selectedKeys)) {
56+
// state.sSelectedKeys = nextProps.selectedKeys;
57+
// }
58+
// if (!shallowequal((preProps.column || {}).filters, (nextProps.column || {}).filters)) {
59+
// state.sValueKeys = generateValueMaps(nextProps.column.filters);
60+
// }
61+
// if ('filterDropdownVisible' in column) {
62+
// state.sVisible = column.filterDropdownVisible;
63+
// }
64+
// preProps = { ...nextProps };
65+
// },
66+
// { flush: 'sync' },
67+
// );
5668
return state;
5769
},
5870

components/vc-select/generate.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ export default function generateSelector<
455455

456456
// Display options for OptionList
457457
const displayOptions = computed<OptionsType>(() => {
458-
if (!mergedSearchValue.value || !mergedShowSearch) {
458+
if (!mergedSearchValue.value || !mergedShowSearch.value) {
459459
return [...mergedOptions.value] as OptionsType;
460460
}
461461
const { optionFilterProp = 'value', mode, filterOption } = props;
@@ -969,7 +969,7 @@ export default function generateSelector<
969969
() => {
970970
if (triggerOpen.value) {
971971
const newWidth = Math.ceil(containerRef.value.offsetWidth);
972-
if (containerWidth !== newWidth) {
972+
if (containerWidth.value !== newWidth) {
973973
containerWidth.value = newWidth;
974974
}
975975
}

components/vc-tabs/src/Tabs.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ export default defineComponent({
4545
setup(props) {
4646
let activeKey;
4747
if (props.activeKey !== undefined) {
48+
// eslint-disable-next-line vue/no-setup-props-destructure
4849
activeKey = props.activeKey;
4950
} else if (props.defaultActiveKey !== undefined) {
51+
// eslint-disable-next-line vue/no-setup-props-destructure
5052
activeKey = props.defaultActiveKey;
5153
} else {
5254
activeKey = getDefaultActiveKey(props);

0 commit comments

Comments
 (0)