Skip to content

OpenUrl 继承自: ClientAction

在控件被激活时打开一个 URL。

它等同于 launch_url,但由客户端在用户的手势操作内执行,因此打开新标签页时不会被当作 非主动请求的弹窗而拦截。

Example: python ft.Button( "Open flet.dev", action=ft.OpenUrl("https://flet.dev", target=ft.UrlTarget.BLANK), )

属性 ​

名称类型默认值说明
urlstraction_要打开的 URL。
targetOptional[Union[UrlTarget, str]]action_NoneWhere to open the URL, for example BLANK for a new tab. Web-only; ignored on other platforms.
service_idint0Internal id of the service that performs this action on the client.
methodstr''Name of the service method invoked on the client.
argsdict[str, Any]{}Arguments passed to method.

关注我,学习大模型、大数据、Python等热门技术。