amis icon indicating copy to clipboard operation
amis copied to clipboard

js sdk 2.1.0 的antd.css的按钮组件的className的样式失效了

Open Chen-Wendong opened this issue 2 years ago • 2 comments

描述问题:

js sdk 2.1.0 的antd.css 在crud下 操作栏的 按钮组件的className的样式失效了

截图或视频:

image

如何复现(请务必完整填写下面内容):

  1. 你是如何使用 amis 的? sdk

  2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在 2.1.0

  3. 粘贴有问题的完整 amis schema 代码:

{
  "type": "button",
  "label": "删除",
  "actionType": "ajax",
  "level": "link",
  "className": "text-danger",
  "confirmText": "确定要删除?",
  "api": {
    "method": "delete",
    "url": "/rampub/crond/${NO}"
  }
}
...
  <link rel="stylesheet" title="default" href="/static/amis/antd.css" />
  <link rel="stylesheet" href="/static/amis/helper.css" />
  <link rel="stylesheet" href="/static/amis/iconfont.css" />

....

 theme: 'antd',
  1. 操作步骤 请简单描述一下复现的操作步骤...

Chen-Wendong avatar Aug 04 '22 10:08 Chen-Wendong

👍 Thanks for this! 🏷 I have applied any labels matching special text in your issue.

Please review the labels and make any necessary changes.

github-actions[bot] avatar Aug 04 '22 10:08 github-actions[bot]

@2betop @nwind @lurunze1226 这个建议调整工具类的优先级为最好,整体加上!important

qianxiaofendou avatar Aug 08 '22 04:08 qianxiaofendou

看了下,应该是2.0版本开始,把工具类移到help里面去了 导致之前的工具类前面是有.amis-scope的,而现在没有了,导致样式的优先级降级了,所以失效了,能想到的解决方案: 1、在help的工具类加上!important来提升优先级,但是这样导致在disabled下面样式异常 2、去掉sdk主题样式打包前面的.amis-scope前缀,使得优先级保持一致, @2betop @nwind @lurunze1226 麻烦各位评估一下,谢谢!

qianxiaofendou avatar Aug 15 '22 02:08 qianxiaofendou