@dongmingzhixiu/vuexir-compiler 0.4.5 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/codegen/swiftui.js +24 -5
- package/package.json +1 -1
package/dist/codegen/swiftui.js
CHANGED
|
@@ -612,11 +612,30 @@ function emitNodeInner(node, ctx) {
|
|
|
612
612
|
}
|
|
613
613
|
// M5 position:absolute → 脱离文档流(父容器已转 ZStack;offset 实现 top/left 定位)
|
|
614
614
|
if (props.position === 'absolute') {
|
|
615
|
-
const
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
615
|
+
const hasRB = props.absRight !== undefined || props.absBottom !== undefined;
|
|
616
|
+
if (hasRB) {
|
|
617
|
+
// R131:right/bottom 定位 → 用对齐 + 内边距表达(此前直接丢弃,导致元素重叠、内容被盖住)
|
|
618
|
+
const v = props.absBottom !== undefined ? 'bottom' : props.absTop !== undefined ? 'top' : 'center';
|
|
619
|
+
const h = props.absRight !== undefined ? 'trailing' : props.absLeft !== undefined ? 'leading' : 'center';
|
|
620
|
+
const align = v === 'center' && h === 'center'
|
|
621
|
+
? 'center'
|
|
622
|
+
: v === 'center'
|
|
623
|
+
? h
|
|
624
|
+
: h === 'center'
|
|
625
|
+
? v
|
|
626
|
+
: `${v}${h[0].toUpperCase()}${h.slice(1)}`;
|
|
627
|
+
box.push(`.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .${align})`);
|
|
628
|
+
if (props.absRight !== undefined)
|
|
629
|
+
box.push(`.padding(.trailing, ${props.absRight})`);
|
|
630
|
+
if (props.absBottom !== undefined)
|
|
631
|
+
box.push(`.padding(.bottom, ${props.absBottom})`);
|
|
632
|
+
if (props.absLeft !== undefined && h !== 'leading')
|
|
633
|
+
box.push(`.padding(.leading, ${props.absLeft})`);
|
|
634
|
+
if (props.absTop !== undefined && v !== 'top')
|
|
635
|
+
box.push(`.padding(.top, ${props.absTop})`);
|
|
636
|
+
}
|
|
637
|
+
else {
|
|
638
|
+
box.push(`.offset(x: ${props.absLeft ?? 0}, y: ${props.absTop ?? 0})`);
|
|
620
639
|
}
|
|
621
640
|
}
|
|
622
641
|
// M5 v-show → opacity 动画切换(保留占位;状态名引用页面/容器同名 @State/@Binding)
|