chore(Layout): improve span

This commit is contained in:
chenjiahan 2020-08-25 15:29:19 +08:00
parent 25cbdecf25
commit a00e6f3474
2 changed files with 3 additions and 6 deletions

View File

@ -16,10 +16,7 @@ export default createComponent({
}, },
setup(props, { slots }) { setup(props, { slots }) {
const { parent, index } = useParent( const { parent, index } = useParent(ROW_KEY, () => +props.span);
ROW_KEY,
computed(() => props.span)
);
const style = computed(() => { const style = computed(() => {
const { spaces } = parent || {}; const { spaces } = parent || {};

View File

@ -27,8 +27,8 @@ export default createComponent({
const groups = [[]]; const groups = [[]];
let totalSpan = 0; let totalSpan = 0;
children.value.forEach((item, index) => { children.value.forEach((getSpan, index) => {
totalSpan += Number(item.value); totalSpan += getSpan();
if (totalSpan > 24) { if (totalSpan > 24) {
groups.push([index]); groups.push([index]);