Skip to content

Commit

Permalink
refactor(grid): update props name
Browse files Browse the repository at this point in the history
  • Loading branch information
novlan1 committed May 27, 2024
1 parent fb99719 commit 442be6a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
13 changes: 3 additions & 10 deletions src/grid/grid-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import isString from 'lodash/isString';
import isFunction from 'lodash/isFunction';

import config from '../config';
import gridItemProps from './grid-item-props';
import props from './grid-item-props';
import { useTNodeJSX } from '../hooks/tnode';
import TImage from '../image';
import TBadge from '../badge';
Expand All @@ -15,9 +15,8 @@ const name = `${prefix}-grid-item`;
export default defineComponent({
name,
components: { TImage, TBadge },
props: gridItemProps,
props,
setup(props, context) {
const internalInstance = getCurrentInstance();
const renderTNodeJSX = useTNodeJSX();
const { column, border, align, gutter } = inject<any>('grid');

Expand Down Expand Up @@ -58,13 +57,7 @@ export default defineComponent({
return (
<div class={gridItemClasses.value} style={rootStyle.value}>
<div class={`${name}__image ${name}__image--${size.value}`}>
{props.badge ? (
<t-badge {...(props.badge as Object)}>
{realImage.value ? <t-image shape="round" {...realImage.value} /> : renderTNodeJSX('image')}
</t-badge>
) : (
renderImage()
)}
{props.badge ? <t-badge {...(props.badge as Object)}>{renderImage()}</t-badge> : renderImage()}
</div>

<div class={`${name}__content ${name}__content--${props.layout}`}>
Expand Down
4 changes: 2 additions & 2 deletions src/grid/grid.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { defineComponent, provide, toRefs, computed } from 'vue';

import config from '../config';
import gridProps from './props';
import props from './props';

const { prefix } = config;
const name = `${prefix}-grid`;

export default defineComponent({
name,
props: gridProps,
props,
setup(props, { slots }) {
const { column, gutter, border, align } = toRefs(props);
const rootStyle = computed(() => {
Expand Down

0 comments on commit 442be6a

Please sign in to comment.