主题
CopyToClipboard 继承自: ClientAction
当控件被激活时,将文本复制到剪贴板。
等价于 set,但由客户端在用户的手势操作内部执行——这也是 Safari 允许页面写入剪贴板的唯一时机。
Example: python ft.Button("Copy token", action=ft.CopyToClipboard(token))
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
data | str | action_ | The text to copy. Must be known before the control is activated. To copy something computed at click time, assign it to this action ahead of the click. |
service_id | int | 0 | Internal id of the service that performs this action on the client. |
method | str | '' | Name of the service method invoked on the client. |
args | dict[str, Any] | {} | Arguments passed to method. |