Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

两套rule切换导致Creator.style("width: 100%")的效果消失 #505

Open
anywo opened this issue Jun 2, 2022 · 5 comments
Open

两套rule切换导致Creator.style("width: 100%")的效果消失 #505

anywo opened this issue Jun 2, 2022 · 5 comments

Comments

@anywo
Copy link

anywo commented Jun 2, 2022

@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%"})一致,或者请大大在文档上标注

@xaboy
Copy link
Owner

xaboy commented Jun 2, 2022

感谢反馈, 我这边检查一下

@xaboy
Copy link
Owner

xaboy commented Jun 5, 2022

这个问题没有复现, 是不是设置display状态导致的, 下个版本做了优化

@xaboy
Copy link
Owner

xaboy commented Jun 5, 2022

2.5.22版本以优化

@anywo
Copy link
Author

anywo commented Jun 5, 2022 via email

@anywo
Copy link
Author

anywo commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants