两套rule切换导致Creator.style("width: 100%")的效果消失
@form-create/ant-design-vue@^2.5.21
UI 框架的版本 (1.7.8)
问题描述
两套规则模板公用一个组件,使用maker创建了个按钮,两套规则切换后,导致Creator.style("width: 100%")的效果消失 替换成Creator.style({width: "100%"})问题解决
复现步骤/生成规则
// rule1,rule2切换使用,导致Creator.style("width: 100%")失效
const btn1 = makeBtn("下一步",()=>{} )
const rule1 = [makeBtnBox([btn1])];
const btn2 = makeBtn("上一步",()=>{} )
const rule2 = [makeBtnBox([btn2])];
// 按钮外框生成方法
function makeBtnBox(btns) {
const btnSpan = 3;
const cols = btns.map((btn) => {
btn.style("width:100%");
return maker.create("a-col").props({ span: btnSpan }).children(btn);
});
return maker
.create("a-row")
.style("width:100%")
.props({ type: "flex", justify: "center", gutter: 24 })
.children(cols);
}
// 按钮生成方法
function makeBtn(text, handleClick, type = "default") {
return maker
.create("a-button")
.props({ type })
.children(text)
.on("click", handleClick);
}
期望的结果
与Creator.style({width: "100%"})一致,或者请大大在文档上标注
感谢反馈, 我这边检查一下
这个问题没有复现, 是不是设置display状态导致的, 下个版本做了优化
2.5.22版本以优化
不太清楚,对象语法时没事,应该也不算是大问题。 1377593732 @.*** 签名由 网易邮箱大师 定制 在2022年06月05日 19:37,xaboy 写道: 2.5.22版本以优化 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
受累 1377593732 @.*** 签名由 网易邮箱大师 定制 在2022年06月02日 10:59,xaboy 写道: 感谢反馈, 我这边检查一下 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>