amis icon indicating copy to clipboard operation
amis copied to clipboard

table2组件中选中表达式`selectedRowKeysExpr`无法与变量比较

Open beemo37 opened this issue 1 year ago • 0 comments

描述问题:

table2组件中选中表达式selectedRowKeysExpr无法与变量比较

截图或视频:


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

  1. 你是如何使用 amis 的?

sdk

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

最新版本6.8.0

  1. 粘贴有问题的完整 amis schema 代码:
{
  "type": "page",
  "data": {
    "myId": 2
  },
  "body": {
    "type": "service",
    "api": "/amis/api/sample?perPage=5",
    "body": [
      "${myId}",
      {
        "type": "table2",
        "source": "$rows",
        "rowSelection": {
          "type": "radio",
          "keyField": "id",
          "disableOn": "this.record.id === 1",
          "selectedRowKeysExpr": "${record.id == myId}"
        },
        "columns": [
          {
            "title": "Engine",
            "name": "engine"
          },
          {
            "title": "Version",
            "name": "version"
          },
          {
            "title": "Browser",
            "name": "browser"
          }
        ]
      }
    ]
  }
}
  1. 操作步骤

粘贴上述json至官网实时渲染能看出效果。 其中 myId是定义在数据域中的,值为2。

  • 当配置"selectedRowKeysExpr": "${record.id == 2}"时就可以选中
  • 当配置"selectedRowKeysExpr": "${record.id == myId}"时就无法选中

beemo37 avatar Sep 30 '24 09:09 beemo37