Skip to content

Commit a13dd20

Browse files
committed
style: format file
1 parent bd1f42a commit a13dd20

File tree

46 files changed

+301
-303
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+301
-303
lines changed

.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"parserOptions": {
1111
"parser": "babel-eslint"
1212
},
13-
"extends": ["plugin:vue/recommended", "prettier"],
13+
"extends": ["plugin:vue/vue3-recommended", "prettier"],
1414
"plugins": ["markdown"],
1515
"overrides": [
1616
{

components/_util/PortalWrapper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ export default defineComponent({
2929
openCount = visible ? openCount + 1 : openCount;
3030
return {};
3131
},
32-
updated() {
33-
this.setWrapperClassName();
34-
},
3532
watch: {
3633
visible(val) {
3734
openCount = val ? openCount + 1 : openCount - 1;
@@ -48,6 +45,9 @@ export default defineComponent({
4845
}
4946
},
5047
},
48+
updated() {
49+
this.setWrapperClassName();
50+
},
5151
beforeUnmount() {
5252
const { visible } = this.$props;
5353
// 离开时不会 render, 导到离开时数值不变,改用 func 。。

components/_util/wave.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ function isNotGrey(color) {
2323
export default defineComponent({
2424
name: 'Wave',
2525
props: ['insertExtraNode'],
26+
setup() {
27+
const configProvider = inject('configProvider', defaultConfigProvider);
28+
return {
29+
configProvider,
30+
};
31+
},
2632
mounted() {
2733
nextTick(() => {
2834
const node = findDOMNode(this);
@@ -32,12 +38,6 @@ export default defineComponent({
3238
this.instance = this.bindAnimationEvent(node);
3339
});
3440
},
35-
setup() {
36-
const configProvider = inject('configProvider', defaultConfigProvider);
37-
return {
38-
configProvider,
39-
};
40-
},
4141
beforeUnmount() {
4242
if (this.instance) {
4343
this.instance.cancel();

components/affix/index.tsx

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ const AffixProps = {
5050
};
5151
const Affix = defineComponent({
5252
name: 'AAffix',
53-
props: AffixProps,
5453
mixins: [BaseMixin],
54+
props: AffixProps,
55+
emits: ['change', 'testUpdatePosition'],
5556
setup() {
5657
return {
5758
configProvider: inject('configProvider', defaultConfigProvider),
5859
};
5960
},
60-
emits: ['change', 'testUpdatePosition'],
6161
data() {
6262
return {
6363
affixStyle: undefined,
@@ -68,25 +68,6 @@ const Affix = defineComponent({
6868
timeout: null,
6969
};
7070
},
71-
beforeMount() {
72-
this.updatePosition = throttleByAnimationFrame(this.updatePosition);
73-
this.lazyUpdatePosition = throttleByAnimationFrame(this.lazyUpdatePosition);
74-
},
75-
mounted() {
76-
const { target } = this;
77-
if (target) {
78-
// [Legacy] Wait for parent component ref has its value.
79-
// We should use target as directly element instead of function which makes element check hard.
80-
this.timeout = setTimeout(() => {
81-
addObserveTarget(target(), this);
82-
// Mock Event object.
83-
this.updatePosition();
84-
});
85-
}
86-
},
87-
updated() {
88-
this.measure();
89-
},
9071
watch: {
9172
target(val) {
9273
let newTarget = null;
@@ -110,6 +91,25 @@ const Affix = defineComponent({
11091
this.updatePosition();
11192
},
11293
},
94+
beforeMount() {
95+
this.updatePosition = throttleByAnimationFrame(this.updatePosition);
96+
this.lazyUpdatePosition = throttleByAnimationFrame(this.lazyUpdatePosition);
97+
},
98+
mounted() {
99+
const { target } = this;
100+
if (target) {
101+
// [Legacy] Wait for parent component ref has its value.
102+
// We should use target as directly element instead of function which makes element check hard.
103+
this.timeout = setTimeout(() => {
104+
addObserveTarget(target(), this);
105+
// Mock Event object.
106+
this.updatePosition();
107+
});
108+
}
109+
},
110+
updated() {
111+
this.measure();
112+
},
113113
beforeUnmount() {
114114
clearTimeout(this.timeout);
115115
removeObserveTarget(this);

components/alert/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ export const AlertProps = {
5959

6060
const Alert = defineComponent({
6161
name: 'AAlert',
62+
mixins: [BaseMixin],
6263
inheritAttrs: false,
6364
props: AlertProps,
64-
mixins: [BaseMixin],
6565
emits: ['close'],
6666
setup() {
6767
return {

components/anchor/Anchor.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ export default defineComponent({
8181
inheritAttrs: false,
8282
props: AnchorProps,
8383
emits: ['change', 'click'],
84+
setup() {
85+
return {
86+
configProvider: inject('configProvider', defaultConfigProvider),
87+
};
88+
},
8489
data() {
8590
// this.links = [];
8691
// this.sPrefixCls = '';
@@ -111,11 +116,6 @@ export default defineComponent({
111116
} as AntAnchor);
112117
provide('antAnchorContext', this);
113118
},
114-
setup() {
115-
return {
116-
configProvider: inject('configProvider', defaultConfigProvider),
117-
};
118-
},
119119
mounted() {
120120
nextTick(() => {
121121
const { getContainer } = this;

components/back-top/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const props = backTopTypes();
1818

1919
const BackTop = defineComponent({
2020
name: 'ABackTop',
21-
inheritAttrs: false,
2221
mixins: [BaseMixin],
22+
inheritAttrs: false,
2323
emits: ['click'],
2424
props: {
2525
...props,

components/calendar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ export const CalendarProps = {
5151

5252
const Calendar = defineComponent({
5353
name: 'ACalendar',
54-
inheritAttrs: false,
5554
mixins: [BaseMixin],
55+
inheritAttrs: false,
5656
props: CalendarProps,
5757
setup() {
5858
return {

components/cascader/index.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,10 @@ function flattenTree(
201201
const defaultDisplayRender = ({ labels }) => labels.join(' / ');
202202

203203
const Cascader = defineComponent({
204-
inheritAttrs: false,
205204
name: 'ACascader',
206205
mixins: [BaseMixin],
206+
inheritAttrs: false,
207207
props: CascaderProps,
208-
// model: {
209-
// prop: 'value',
210-
// event: 'change',
211-
// },
212-
created() {
213-
provide('savePopupRef', this.savePopupRef);
214-
},
215208
setup() {
216209
return {
217210
configProvider: inject('configProvider', defaultConfigProvider),
@@ -244,6 +237,13 @@ const Cascader = defineComponent({
244237
}
245238
},
246239
},
240+
// model: {
241+
// prop: 'value',
242+
// event: 'change',
243+
// },
244+
created() {
245+
provide('savePopupRef', this.savePopupRef);
246+
},
247247
methods: {
248248
savePopupRef(ref: any) {
249249
this.popupRef = ref;

components/checkbox/Group.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ export default defineComponent({
2525
disabled: PropTypes.looseBool,
2626
onChange: PropTypes.func,
2727
},
28+
setup() {
29+
return {
30+
configProvider: inject('configProvider', defaultConfigProvider),
31+
};
32+
},
2833

2934
data() {
3035
const { value, defaultValue } = this;
@@ -38,11 +43,6 @@ export default defineComponent({
3843
this.sValue = val || [];
3944
},
4045
},
41-
setup() {
42-
return {
43-
configProvider: inject('configProvider', defaultConfigProvider),
44-
};
45-
},
4646
created() {
4747
provide('checkboxGroupContext', this);
4848
},

0 commit comments

Comments
 (0)