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

Question: queryTable 列表中的操作栏 #109

Open
2401345934 opened this issue May 26, 2021 · 5 comments
Open

Question: queryTable 列表中的操作栏 #109

2401345934 opened this issue May 26, 2021 · 5 comments

Comments

@2401345934
Copy link

Question

Description

type = like 的时候 可以不可以传入一个属性让其不冒泡
目前列表要做 antd onRow 行点击事件 type = like 的触发的action 会导致 冒泡到 行点击
image

@xz8la8
Copy link
Member

xz8la8 commented May 26, 2021

麻烦给我一个完整的QueryTable配置,我在本地试试

@2401345934
Copy link
Author

2401345934 commented May 26, 2021

const config = {
    fields: [
      {
        name: 'qp-propertyGroupName-like',
        label: '属性组名称',
        field: {
          type: 'input',
          props: {
            placeholder: '输入属性组名称',
          },
        },
      },
    ],
    columns: [
      {
        key: 'alias',
        title: '属性组别称',
      },
      {
        key: 'operaction',
        title: '操作',
        fixed: 'right',
        render: [
          {
            type: 'link',
            props: {
              type: 'primary',
              children: '编辑',
            },
            action: [
              {
                type: 'route',
                path: '/commodityManagement/attributeGroup/edit?id=#{record.id}&type=edit',
              },
            ],
          },
        ],
      },
    ],
    rowKey: 'id',
    tableProps: {
      onRow: (record) => {
        return {
          onClick: () => {
            console.log(1,2)
          }, // 点击行
        };
      },
    },
  };

@2401345934
Copy link
Author

麻烦给我一个完整的QueryTable配置,我在本地试试

就是 类似我点击了编辑 按钮 但是也触发了 onRow 的 onClick 除非我手写render 但是又想用sula 的 自带的loading

@2401345934
Copy link
Author

麻烦给我一个完整的QueryTable配置,我在本地试试

image

自己手动去写的话 可以拿到 事件源去控制 但是 直接使用 action 的ctx 好像没有把事件源 暴露出来

@xz8la8
Copy link
Member

xz8la8 commented May 26, 2021

明白你问题,等我看下哈

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