style: format

pull/4671/head
tangjinzhou 3 years ago
parent 16f8d43a1a
commit cc86cbf7bc

@ -231,7 +231,7 @@ export default defineComponent({
return () => {
const subMenuPrefixClsValue = subMenuPrefixCls.value;
let baseTitleNode = () => {
const baseTitleNode = () => {
const icon = getPropsSlot(slots, props, 'icon');
const expandIcon = props.expandIcon || slots.expandIcon || menuExpandIcon.value;
const title = renderTitle(getPropsSlot(slots, props, 'title'), icon);

@ -58,13 +58,11 @@ export interface MenuContextProps {
// // Motion
motion?: ComputedRef<CSSMotionProps | null>;
defaultMotions?: ComputedRef<Partial<
{
defaultMotions?: ComputedRef<Partial<{
[key in MenuMode | 'other']:
| CSSMotionProps
| ((style: Ref<CSSProperties>, className: Ref<string>) => CSSMotionProps);
}
> | null>;
}> | null>;
// // Popup
subMenuOpenDelay: ComputedRef<number>;

@ -3,7 +3,7 @@ import type { ModalFuncProps } from './Modal';
import Dialog from './Modal';
import ActionButton from './ActionButton';
import { getConfirmLocale } from './locale';
import { FunctionalComponent } from 'vue';
import type { FunctionalComponent } from 'vue';
interface ConfirmDialogProps extends ModalFuncProps {
afterClose?: () => void;

@ -132,10 +132,13 @@ export const tableProps = () => {
type: Number as PropType<TableProps['expandColumnWidth']>,
default: undefined,
},
expandedRowKeys: { type: Array as PropType<TableProps['expandedRowKeys']>, default: undefined },
expandedRowKeys: {
type: Array as PropType<TableProps['expandedRowKeys']>,
default: undefined as TableProps['expandedRowKeys'],
},
defaultExpandedRowKeys: {
type: Array as PropType<TableProps['defaultExpandedRowKeys']>,
default: undefined,
default: undefined as TableProps['defaultExpandedRowKeys'],
},
expandedRowRender: {
type: Function as PropType<TableProps['expandedRowRender']>,
@ -605,6 +608,8 @@ const InteralTable = defineComponent<
<RcTable
{...attrs}
{...tableProps}
expandedRowKeys={props.expandedRowKeys as any}
defaultExpandedRowKeys={props.defaultExpandedRowKeys as any}
expandIconColumnIndex={expandIconColumnIndex.value}
indentSize={indentSize.value}
expandIcon={expandIcon}
@ -649,7 +654,7 @@ const Table = defineComponent<TableProps>({
table,
});
return () => {
const columns = (attrs.columns || convertChildrenToColumns(slots.default?.())) as ColumnsType;
const columns = attrs.columns || convertChildrenToColumns(slots.default?.());
return (
<InteralTable
ref={table}

@ -1,6 +1,6 @@
import classNames from '../../_util/classNames';
import { flattenChildren, isValidElement, parseStyleText } from '../../_util/props-util';
import { CSSProperties, HTMLAttributes } from 'vue';
import type { CSSProperties, HTMLAttributes } from 'vue';
import { defineComponent, isVNode } from 'vue';
import type {

@ -16,6 +16,7 @@ import type {
ExpandedRowRender,
RenderExpandIcon,
TransformCellText,
DefaultRecordType,
} from './interface';
import Body from './Body';
import useColumns from './hooks/useColumns';
@ -65,7 +66,7 @@ const EMPTY_SCROLL_TARGET = {};
export const INTERNAL_HOOKS = 'rc-table-internal-hook';
export interface TableProps<RecordType = unknown> {
export interface TableProps<RecordType = DefaultRecordType> {
prefixCls?: string;
data?: RecordType[];
columns?: ColumnsType<RecordType>;
@ -143,7 +144,7 @@ export interface TableProps<RecordType = unknown> {
transformCellText?: TransformCellText<RecordType>;
}
export default defineComponent<TableProps>({
export default defineComponent<TableProps<DefaultRecordType>>({
name: 'Table',
inheritAttrs: false,
props: [
@ -190,7 +191,6 @@ export default defineComponent<TableProps>({
setup(props, { attrs, slots, emit }) {
const mergedData = computed(() => props.data || EMPTY_DATA);
const hasData = computed(() => !!mergedData.value.length);
// ==================== Customize =====================
const mergedComponents = computed(() =>
mergeObject<TableComponents<any>>(props.components, {}),

@ -141,9 +141,9 @@
"eslint-config-prettier": "^8.0.0",
"eslint-plugin-html": "^6.0.0",
"eslint-plugin-jest": "^24.3.6",
"eslint-plugin-markdown": "^2.0.0-alpha.0",
"eslint-plugin-markdown": "^2.0.0",
"eslint-plugin-no-explicit-type-exports": "^0.11.10",
"eslint-plugin-prettier": "^3.1.4",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-vue": "^7.1.0",
"fetch-jsonp": "^1.1.3",
"fs-extra": "^10.0.0",

Loading…
Cancel
Save