harmony 鸿蒙Class (DataResubmissionHandler)
Class (DataResubmissionHandler)
通过DataResubmissionHandler可以重新提交表单数据或取消提交表单数据。
说明:
本模块接口从API version 9开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
示例效果请以真机运行为准,当前IDE预览器不支持。
constructor9+
constructor()
DataResubmissionHandler的构造函数。
系统能力: SystemCapability.Web.Webview.Core
resend9+
resend(): void
重新发送表单数据。
系统能力: SystemCapability.Web.Webview.Core
示例:
// xxx.ets
import { webview } from '@kit.ArkWeb';
@Entry
@Component
struct WebComponent {
controller: webview.WebviewController = new webview.WebviewController();
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
.onDataResubmitted((event) => {
console.log('onDataResubmitted');
event.handler.resend();
})
}
}
}
cancel9+
cancel(): void
取消重新发送表单数据。
系统能力: SystemCapability.Web.Webview.Core
示例:
// xxx.ets
import { webview } from '@kit.ArkWeb';
@Entry
@Component
struct WebComponent {
controller: webview.WebviewController = new webview.WebviewController();
build() {
Column() {
Web({ src: 'www.example.com', controller: this.controller })
.onDataResubmitted((event) => {
console.log('onDataResubmitted');
event.handler.cancel();
})
}
}
}
你可能感兴趣的鸿蒙文章
harmony 鸿蒙ArkWeb_ControllerAPI
harmony 鸿蒙ArkWeb_CookieManagerAPI
harmony 鸿蒙ArkWeb_JavaScriptBridgeData
harmony 鸿蒙ArkWeb_JavaScriptObject
0
赞
- 所属分类: 后端技术
- 本文标签:
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦