Skip to content

Commit 789647c

Browse files
committed
test: update test & ts
1 parent 9de1b59 commit 789647c

File tree

32 files changed

+116
-117
lines changed

32 files changed

+116
-117
lines changed

antdv-demo

components/_util/BaseMixin.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { nextTick } from 'vue';
12
import { getOptionProps } from './props-util';
23

34
export default {
@@ -19,7 +20,7 @@ export default {
1920
if (this._.isMounted) {
2021
this.$forceUpdate();
2122
}
22-
this.$nextTick(() => {
23+
nextTick(() => {
2324
callback && callback();
2425
});
2526
},

components/_util/BaseMixin2.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { nextTick } from 'vue';
12
import { getOptionProps } from './props-util';
23

34
export default {
@@ -19,7 +20,7 @@ export default {
1920
if (this._.isMounted) {
2021
this.$forceUpdate();
2122
}
22-
this.$nextTick(() => {
23+
nextTick(() => {
2324
callback && callback();
2425
});
2526
},

components/_util/Portal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import PropTypes from './vue-types';
2-
import { defineComponent, Teleport } from 'vue';
2+
import { defineComponent, nextTick, Teleport } from 'vue';
33

44
export default defineComponent({
55
name: 'Portal',
@@ -18,7 +18,7 @@ export default defineComponent({
1818
updated() {
1919
const { didUpdate } = this.$props;
2020
if (didUpdate) {
21-
this.$nextTick(() => {
21+
nextTick(() => {
2222
didUpdate(this.$props);
2323
});
2424
}

components/anchor/Anchor.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, inject, provide } from 'vue';
1+
import { defineComponent, inject, nextTick, provide } from 'vue';
22
import PropTypes from '../_util/vue-types';
33
import classNames from '../_util/classNames';
44
import addEventListener from '../vc-util/Dom/addEventListener';
@@ -117,15 +117,15 @@ export default defineComponent({
117117
};
118118
},
119119
mounted() {
120-
this.$nextTick(() => {
120+
nextTick(() => {
121121
const { getContainer } = this;
122122
this.scrollContainer = getContainer();
123123
this.scrollEvent = addEventListener(this.scrollContainer, 'scroll', this.handleScroll);
124124
this.handleScroll();
125125
});
126126
},
127127
updated() {
128-
this.$nextTick(() => {
128+
nextTick(() => {
129129
if (this.scrollEvent) {
130130
const { getContainer } = this;
131131
const currentContainer = getContainer();

components/anchor/AnchorLink.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ComponentPublicInstance, defineComponent, inject } from 'vue';
1+
import { ComponentPublicInstance, defineComponent, inject, nextTick } from 'vue';
22
import PropTypes from '../_util/vue-types';
33
import { getComponent } from '../_util/props-util';
44
import classNames from '../_util/classNames';
@@ -32,7 +32,7 @@ export default defineComponent({
3232
},
3333
watch: {
3434
href(val, oldVal) {
35-
this.$nextTick(() => {
35+
nextTick(() => {
3636
this.antAnchor.unregisterLink(oldVal);
3737
this.antAnchor.registerLink(val);
3838
});

components/avatar/Avatar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { tuple, VueNode } from '../_util/type';
2-
import { CSSProperties, defineComponent, inject, PropType } from 'vue';
2+
import { CSSProperties, defineComponent, inject, nextTick, PropType } from 'vue';
33
import { defaultConfigProvider } from '../config-provider';
44
import { getComponent } from '../_util/props-util';
55
import PropTypes from '../_util/vue-types';
@@ -40,7 +40,7 @@ export default defineComponent({
4040
},
4141
watch: {
4242
src() {
43-
this.$nextTick(() => {
43+
nextTick(() => {
4444
this.isImgExist = true;
4545
this.scale = 1;
4646
// force uodate for position
@@ -49,13 +49,13 @@ export default defineComponent({
4949
},
5050
},
5151
mounted() {
52-
this.$nextTick(() => {
52+
nextTick(() => {
5353
this.setScale();
5454
this.isMounted = true;
5555
});
5656
},
5757
updated() {
58-
this.$nextTick(() => {
58+
nextTick(() => {
5959
this.setScale();
6060
});
6161
},

components/back-top/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { App, defineComponent, inject } from 'vue';
1+
import { App, defineComponent, inject, nextTick } from 'vue';
22
import classNames from '../_util/classNames';
33
import PropTypes from '../_util/vue-types';
44
import backTopTypes from './backTopTypes';
@@ -36,7 +36,7 @@ const BackTop = defineComponent({
3636
};
3737
},
3838
mounted() {
39-
this.$nextTick(() => {
39+
nextTick(() => {
4040
const getTarget = this.target || getDefaultTarget;
4141
this.scrollEvent = addEventListener(getTarget(), 'scroll', this.handleScroll);
4242
this.handleScroll();

components/cascader/index.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,13 +231,6 @@ const Cascader = defineComponent({
231231
flattenOptions: showSearch ? flattenTree(options, this.$props) : undefined,
232232
};
233233
},
234-
// mounted() {
235-
// this.$nextTick(() => {
236-
// if (this.autofocus && !this.showSearch && !this.disabled) {
237-
// this.$refs.picker.focus();
238-
// }
239-
// });
240-
// },
241234
watch: {
242235
value(val) {
243236
this.setState({ sValue: val || [] });

components/checkbox/Checkbox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { defineComponent, inject } from 'vue';
1+
import { defineComponent, inject, nextTick } from 'vue';
22
import PropTypes from '../_util/vue-types';
33
import classNames from '../_util/classNames';
44
import VcCheckbox from '../vc-checkbox';
@@ -36,7 +36,7 @@ export default defineComponent({
3636

3737
watch: {
3838
value(value, prevValue) {
39-
this.$nextTick(() => {
39+
nextTick(() => {
4040
const { checkboxGroupContext: checkboxGroup = {} } = this;
4141
if (checkboxGroup.registerValue && checkboxGroup.cancelValue) {
4242
checkboxGroup.cancelValue(prevValue);

0 commit comments

Comments
 (0)