mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-24 10:20:19 +08:00
chore(Layout): improve span
This commit is contained in:
parent
25cbdecf25
commit
a00e6f3474
@ -16,10 +16,7 @@ export default createComponent({
|
||||
},
|
||||
|
||||
setup(props, { slots }) {
|
||||
const { parent, index } = useParent(
|
||||
ROW_KEY,
|
||||
computed(() => props.span)
|
||||
);
|
||||
const { parent, index } = useParent(ROW_KEY, () => +props.span);
|
||||
|
||||
const style = computed(() => {
|
||||
const { spaces } = parent || {};
|
||||
|
@ -27,8 +27,8 @@ export default createComponent({
|
||||
const groups = [[]];
|
||||
|
||||
let totalSpan = 0;
|
||||
children.value.forEach((item, index) => {
|
||||
totalSpan += Number(item.value);
|
||||
children.value.forEach((getSpan, index) => {
|
||||
totalSpan += getSpan();
|
||||
|
||||
if (totalSpan > 24) {
|
||||
groups.push([index]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user