fix: grid props
parent
5832a70644
commit
8124653d07
|
@ -43,9 +43,10 @@ function parseFlex(flex: FlexType): string {
|
|||
return flex;
|
||||
}
|
||||
|
||||
export default defineComponent<ColProps>({
|
||||
export default defineComponent({
|
||||
name: 'ACol',
|
||||
setup(props, { slots }) {
|
||||
inheritAttrs: false,
|
||||
setup(_: ColProps, { slots, attrs }) {
|
||||
const configProvider = inject('configProvider', defaultConfigProvider);
|
||||
const rowContext = inject<rowContextState>('rowContext', {});
|
||||
|
||||
|
@ -62,12 +63,12 @@ export default defineComponent<ColProps>({
|
|||
flex,
|
||||
style,
|
||||
...others
|
||||
} = props;
|
||||
} = attrs as ColProps;
|
||||
const prefixCls = configProvider.getPrefixCls('col', customizePrefixCls);
|
||||
let sizeClassObj = {};
|
||||
['xs', 'sm', 'md', 'lg', 'xl', 'xxl'].forEach(size => {
|
||||
let sizeProps: ColSize = {};
|
||||
const propSize = (props as any)[size];
|
||||
const propSize = attrs[size];
|
||||
if (typeof propSize === 'number') {
|
||||
sizeProps.span = propSize;
|
||||
} else if (typeof propSize === 'object') {
|
||||
|
|
|
@ -8,7 +8,7 @@ import {
|
|||
onMounted,
|
||||
onBeforeUnmount,
|
||||
} from 'vue';
|
||||
import classNames from 'classnames';
|
||||
import classNames from '../_util/classNames';
|
||||
import { tuple } from '../_util/type';
|
||||
import PropTypes from '../_util/vue-types';
|
||||
import { defaultConfigProvider } from '../config-provider';
|
||||
|
@ -43,12 +43,14 @@ export interface RowProps extends HTMLAttributes {
|
|||
|
||||
export default defineComponent<RowProps>({
|
||||
name: 'ARow',
|
||||
setup(props, { slots }) {
|
||||
setup(_: RowProps, { slots, attrs }) {
|
||||
const rowContext = reactive<rowContextState>({
|
||||
gutter: undefined,
|
||||
});
|
||||
provide('rowContext', rowContext);
|
||||
|
||||
const props = attrs as RowProps;
|
||||
|
||||
let token: number;
|
||||
|
||||
onMounted(() => {
|
||||
|
|
Loading…
Reference in New Issue