style: prettier code

pull/3143/head
tanjinzhou 2020-10-28 11:32:38 +08:00
parent ce1148838b
commit ef9797d337
11 changed files with 48 additions and 34 deletions

@ -1 +1 @@
Subproject commit 42118ce953ddcaf9a470b5e9c8c9980f01d5c628 Subproject commit 21cd58ca984d96916ff9c4a2f34bb5e245d9a324

View File

@ -56,7 +56,12 @@ const renderTitle = (h, prefixCls, instance) => {
const subTitle = getComponentFromProp(instance, 'subTitle'); const subTitle = getComponentFromProp(instance, 'subTitle');
const tags = getComponentFromProp(instance, 'tags'); const tags = getComponentFromProp(instance, 'tags');
const extra = getComponentFromProp(instance, 'extra'); const extra = getComponentFromProp(instance, 'extra');
const backIcon = getComponentFromProp(instance, 'backIcon') !== undefined ? getComponentFromProp(instance, 'backIcon') : <Icon type="arrow-left" />; const backIcon =
getComponentFromProp(instance, 'backIcon') !== undefined ? (
getComponentFromProp(instance, 'backIcon')
) : (
<Icon type="arrow-left" />
);
const onBack = instance.$listeners.back; const onBack = instance.$listeners.back;
const headingPrefixCls = `${prefixCls}-heading`; const headingPrefixCls = `${prefixCls}-heading`;
if (title || subTitle || tags || extra) { if (title || subTitle || tags || extra) {

View File

@ -49,7 +49,7 @@ export default {
methods: { methods: {
removeTab(targetKey, e) { removeTab(targetKey, e) {
e.stopPropagation(); e.stopPropagation();
if(isValid(targetKey)) { if (isValid(targetKey)) {
this.$emit('edit', targetKey, 'remove'); this.$emit('edit', targetKey, 'remove');
} }
}, },

View File

@ -261,7 +261,7 @@ export default {
reject: this.onReject, reject: this.onReject,
}, },
ref: 'uploadRef', ref: 'uploadRef',
attrs: {...this.$attrs}, attrs: { ...this.$attrs },
}; };
const children = this.$slots.default; const children = this.$slots.default;
// Remove id to avoid open by label when trigger is hidden // Remove id to avoid open by label when trigger is hidden
@ -308,8 +308,6 @@ export default {
[`${prefixCls}-disabled`]: disabled, [`${prefixCls}-disabled`]: disabled,
}); });
const uploadButton = ( const uploadButton = (
<div class={uploadButtonCls} style={children ? undefined : { display: 'none' }}> <div class={uploadButtonCls} style={children ? undefined : { display: 'none' }}>
<VcUpload {...vcUploadProps}>{children}</VcUpload> <VcUpload {...vcUploadProps}>{children}</VcUpload>

View File

@ -25,7 +25,11 @@ const Calendar = {
name: 'Calendar', name: 'Calendar',
props: { props: {
locale: PropTypes.object.def(enUs), locale: PropTypes.object.def(enUs),
format: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string), PropTypes.func]), format: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string),
PropTypes.func,
]),
visible: PropTypes.bool.def(true), visible: PropTypes.bool.def(true),
prefixCls: PropTypes.string.def('rc-calendar'), prefixCls: PropTypes.string.def('rc-calendar'),
// prefixCls: PropTypes.string, // prefixCls: PropTypes.string,

View File

@ -110,7 +110,11 @@ const RangeCalendar = {
// onValueChange: PropTypes.func, // onValueChange: PropTypes.func,
// onHoverChange: PropTypes.func, // onHoverChange: PropTypes.func,
// onPanelChange: PropTypes.func, // onPanelChange: PropTypes.func,
format: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string), PropTypes.func]), format: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string),
PropTypes.func,
]),
// onClear: PropTypes.func, // onClear: PropTypes.func,
type: PropTypes.any.def('both'), type: PropTypes.any.def('both'),
disabledDate: PropTypes.func, disabledDate: PropTypes.func,

View File

@ -16,7 +16,11 @@ const DateInput = {
timePicker: PropTypes.object, timePicker: PropTypes.object,
value: PropTypes.object, value: PropTypes.object,
disabledTime: PropTypes.any, disabledTime: PropTypes.any,
format: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string), PropTypes.func]), format: PropTypes.oneOfType([
PropTypes.string,
PropTypes.arrayOf(PropTypes.string),
PropTypes.func,
]),
locale: PropTypes.object, locale: PropTypes.object,
disabledDate: PropTypes.func, disabledDate: PropTypes.func,
// onChange: PropTypes.func, // onChange: PropTypes.func,

View File

@ -158,11 +158,11 @@ const BaseTable = {
tableStyle.width = tableStyle.width =
typeof tableStyle.width === 'number' ? `${tableStyle.width}px` : tableStyle.width; typeof tableStyle.width === 'number' ? `${tableStyle.width}px` : tableStyle.width;
} }
if(fixed) { if (fixed) {
const width = columns.reduce((sum, {width: w})=>{ const width = columns.reduce((sum, { width: w }) => {
return sum + parseFloat(w, 10); return sum + parseFloat(w, 10);
}, 0); }, 0);
if(width > 0) { if (width > 0) {
tableStyle.width = width + 'px'; tableStyle.width = width + 'px';
} }
} }

View File

@ -6,13 +6,13 @@ import Pickr from '@simonwep/pickr';
export declare class ColorPicker extends AntdComponent { export declare class ColorPicker extends AntdComponent {
/** simonwep/pickr's options */ /** simonwep/pickr's options */
config?:Pickr.Options config?: Pickr.Options;
/**prefix class name */ /**prefix class name */
prefixCls?: string prefixCls?: string;
/** default color value */ /** default color value */
defaultValue?: string defaultValue?: string;
/** color value */ /** color value */
value?: string value?: string;
/** /**
* language package setting * language package setting
* @type object * @type object
@ -23,7 +23,7 @@ export declare class ColorPicker extends AntdComponent {
* @default 0 * @default 0
* @type number * @type number
* */ * */
colorRounded?:number colorRounded?: number;
/** /**
* descriptions size type * descriptions size type
* @default 'default' * @default 'default'
@ -42,10 +42,10 @@ export declare class ColorPicker extends AntdComponent {
* @default false * @default false
* @type boolean * @type boolean
*/ */
disabled: boolean disabled: boolean;
/** /**
* to set the color format * to set the color format
* @default "HEXA" * @default "HEXA"
*/ */
format: Pickr.Representation format: Pickr.Representation;
} }

4
types/message.d.ts vendored
View File

@ -2,7 +2,7 @@
// Definitions by: akki-jat <https://github.com/akki-jat> // Definitions by: akki-jat <https://github.com/akki-jat>
// Definitions: https://github.com/vueComponent/ant-design-vue/types // Definitions: https://github.com/vueComponent/ant-design-vue/types
import { VNode, CreateElement } from 'vue' import { VNode, CreateElement } from 'vue';
export interface ThenableArgument { export interface ThenableArgument {
(val: any): void; (val: any): void;
@ -12,7 +12,7 @@ export interface MessageType {
then: (fill: ThenableArgument, reject: ThenableArgument) => Promise<void>; then: (fill: ThenableArgument, reject: ThenableArgument) => Promise<void>;
promise: Promise<void>; promise: Promise<void>;
} }
export type ConfigType = string | VNode | ((h: CreateElement) => VNode); export type ConfigType = string | VNode | ((h: CreateElement) => VNode);
export type ConfigDuration = number | (() => void); export type ConfigDuration = number | (() => void);
export type ConfigOnClose = () => void; export type ConfigOnClose = () => void;

View File

@ -21,16 +21,15 @@ export declare class Column extends AntdComponent {
* @type string * @type string
*/ */
align?: 'left' | 'right' | 'center'; align?: 'left' | 'right' | 'center';
/** /**
* ellipsize cell content, not working with sorter and filters for now. * ellipsize cell content, not working with sorter and filters for now.
* tableLayout would be fixed when ellipsis is true. * tableLayout would be fixed when ellipsis is true.
* @default false * @default false
* @type boolean * @type boolean
*/ */
ellipsis?: boolean; ellipsis?: boolean;
/** /**
* Span of this column's title * Span of this column's title
* @type number * @type number
@ -42,11 +41,11 @@ export declare class Column extends AntdComponent {
* @type string * @type string
*/ */
dataIndex?: string; dataIndex?: string;
/** /**
* Default filtered values * Default filtered values
* @type string[] * @type string[]
*/ */
defaultFilteredValue?: string[]; defaultFilteredValue?: string[];
/** /**
@ -130,14 +129,14 @@ export declare class Column extends AntdComponent {
* @type boolean | string * @type boolean | string
*/ */
sortOrder?: boolean | SortOrder; sortOrder?: boolean | SortOrder;
/** /**
* supported sort way, could be 'ascend', 'descend' * supported sort way, could be 'ascend', 'descend'
* @default ['ascend', 'descend'] * @default ['ascend', 'descend']
* @type string[] * @type string[]
*/ */
sortDirections?: string[]; sortDirections?: string[];
/** /**
* Title of this column * Title of this column
* @type any (string | slot) * @type any (string | slot)