mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-23 18:00:27 +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 }) {
|
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 || {};
|
||||||
|
@ -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]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user