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

useTable contextMenu 如何获取当前选中行? #86

Closed
ywzhaiqi opened this issue Jun 15, 2023 · 1 comment
Closed

useTable contextMenu 如何获取当前选中行? #86

ywzhaiqi opened this issue Jun 15, 2023 · 1 comment

Comments

@ywzhaiqi
Copy link

const Table = useTable({
	contextMenu: [
		"refresh",
		"check",
		"update",
		"delete",
		"order-desc",
		"order-asc",
		{ label: "测试", callback() {} }
	]
});

测试 菜单点击后,要获取当前选中的行数据,目前好像无法实现?

@ywzhaiqi
Copy link
Author

ywzhaiqi commented Jun 15, 2023

研究了下源码,如下的可行。

const Table = useTable({
    contextMenu: [
        "refresh",
        (row: obj) => {
            return {
                label: "测试",
                callback(done: fn) {
                    console.log(row)
                    done()
                }
            }
        }
    ]
})

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

1 participant