Skip to content

Commit ef9797d

Browse files
committed
style: prettier code
1 parent ce11488 commit ef9797d

File tree

11 files changed

+48
-34
lines changed

11 files changed

+48
-34
lines changed

antdv-demo

components/page-header/index.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,12 @@ const renderTitle = (h, prefixCls, instance) => {
5656
const subTitle = getComponentFromProp(instance, 'subTitle');
5757
const tags = getComponentFromProp(instance, 'tags');
5858
const extra = getComponentFromProp(instance, 'extra');
59-
const backIcon = getComponentFromProp(instance, 'backIcon') !== undefined ? getComponentFromProp(instance, 'backIcon') : <Icon type="arrow-left" />;
59+
const backIcon =
60+
getComponentFromProp(instance, 'backIcon') !== undefined ? (
61+
getComponentFromProp(instance, 'backIcon')
62+
) : (
63+
<Icon type="arrow-left" />
64+
);
6065
const onBack = instance.$listeners.back;
6166
const headingPrefixCls = `${prefixCls}-heading`;
6267
if (title || subTitle || tags || extra) {

components/tabs/tabs.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export default {
4949
methods: {
5050
removeTab(targetKey, e) {
5151
e.stopPropagation();
52-
if(isValid(targetKey)) {
52+
if (isValid(targetKey)) {
5353
this.$emit('edit', targetKey, 'remove');
5454
}
5555
},

components/upload/Upload.jsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ export default {
261261
reject: this.onReject,
262262
},
263263
ref: 'uploadRef',
264-
attrs: {...this.$attrs},
264+
attrs: { ...this.$attrs },
265265
};
266266
const children = this.$slots.default;
267267
// Remove id to avoid open by label when trigger is hidden
@@ -308,8 +308,6 @@ export default {
308308
[`${prefixCls}-disabled`]: disabled,
309309
});
310310

311-
312-
313311
const uploadButton = (
314312
<div class={uploadButtonCls} style={children ? undefined : { display: 'none' }}>
315313
<VcUpload {...vcUploadProps}>{children}</VcUpload>

components/vc-calendar/src/Calendar.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ const Calendar = {
2525
name: 'Calendar',
2626
props: {
2727
locale: PropTypes.object.def(enUs),
28-
format: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
28+
format: PropTypes.oneOfType([
29+
PropTypes.string,
30+
PropTypes.arrayOf(PropTypes.string),
31+
PropTypes.func,
32+
]),
2933
visible: PropTypes.bool.def(true),
3034
prefixCls: PropTypes.string.def('rc-calendar'),
3135
// prefixCls: PropTypes.string,

components/vc-calendar/src/RangeCalendar.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ const RangeCalendar = {
110110
// onValueChange: PropTypes.func,
111111
// onHoverChange: PropTypes.func,
112112
// onPanelChange: PropTypes.func,
113-
format: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
113+
format: PropTypes.oneOfType([
114+
PropTypes.string,
115+
PropTypes.arrayOf(PropTypes.string),
116+
PropTypes.func,
117+
]),
114118
// onClear: PropTypes.func,
115119
type: PropTypes.any.def('both'),
116120
disabledDate: PropTypes.func,

components/vc-calendar/src/date/DateInput.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ const DateInput = {
1616
timePicker: PropTypes.object,
1717
value: PropTypes.object,
1818
disabledTime: PropTypes.any,
19-
format: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string), PropTypes.func]),
19+
format: PropTypes.oneOfType([
20+
PropTypes.string,
21+
PropTypes.arrayOf(PropTypes.string),
22+
PropTypes.func,
23+
]),
2024
locale: PropTypes.object,
2125
disabledDate: PropTypes.func,
2226
// onChange: PropTypes.func,

components/vc-table/src/BaseTable.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ const BaseTable = {
158158
tableStyle.width =
159159
typeof tableStyle.width === 'number' ? `${tableStyle.width}px` : tableStyle.width;
160160
}
161-
if(fixed) {
162-
const width = columns.reduce((sum, {width: w})=>{
161+
if (fixed) {
162+
const width = columns.reduce((sum, { width: w }) => {
163163
return sum + parseFloat(w, 10);
164164
}, 0);
165-
if(width > 0) {
165+
if (width > 0) {
166166
tableStyle.width = width + 'px';
167167
}
168168
}

types/color-picker.d.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import Pickr from '@simonwep/pickr';
66

77
export declare class ColorPicker extends AntdComponent {
88
/** simonwep/pickr's options */
9-
config?:Pickr.Options
9+
config?: Pickr.Options;
1010
/**prefix class name */
11-
prefixCls?: string
11+
prefixCls?: string;
1212
/** default color value */
13-
defaultValue?: string
13+
defaultValue?: string;
1414
/** color value */
15-
value?: string
15+
value?: string;
1616
/**
1717
* language package setting
1818
* @type object
@@ -23,7 +23,7 @@ export declare class ColorPicker extends AntdComponent {
2323
* @default 0
2424
* @type number
2525
* */
26-
colorRounded?:number
26+
colorRounded?: number;
2727
/**
2828
* descriptions size type
2929
* @default 'default'
@@ -42,10 +42,10 @@ export declare class ColorPicker extends AntdComponent {
4242
* @default false
4343
* @type boolean
4444
*/
45-
disabled: boolean
45+
disabled: boolean;
4646
/**
4747
* to set the color format
4848
* @default "HEXA"
4949
*/
50-
format: Pickr.Representation
50+
format: Pickr.Representation;
5151
}

types/message.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Definitions by: akki-jat <https://github.com/akki-jat>
33
// Definitions: https://github.com/vueComponent/ant-design-vue/types
44

5-
import { VNode, CreateElement } from 'vue'
5+
import { VNode, CreateElement } from 'vue';
66

77
export interface ThenableArgument {
88
(val: any): void;
@@ -12,7 +12,7 @@ export interface MessageType {
1212
then: (fill: ThenableArgument, reject: ThenableArgument) => Promise<void>;
1313
promise: Promise<void>;
1414
}
15-
export type ConfigType = string | VNode | ((h: CreateElement) => VNode);
15+
export type ConfigType = string | VNode | ((h: CreateElement) => VNode);
1616
export type ConfigDuration = number | (() => void);
1717
export type ConfigOnClose = () => void;
1818

0 commit comments

Comments
 (0)