diff --git a/zh-cn/application-dev/reference/apis/js-apis-wifi.md b/zh-cn/application-dev/reference/apis/js-apis-wifi.md index 1baf4c49146c64313214e6dc11f7cc3361a6efad..cce0deb9c7d481d3d443f6920563961b590c523e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-wifi.md +++ b/zh-cn/application-dev/reference/apis/js-apis-wifi.md @@ -1857,16 +1857,15 @@ off(type: "wifiStateChange", callback?: Callback<number>): void ```js import wifi from '@ohos.wifi'; - var WIFI_POWER_STATE = "wifiStateChange"; var recvPowerNotifyFunc = result => { console.info("Receive power state change event: " + result); } // Register event - wifi.on(WIFI_POWER_STATE, recvPowerNotifyFunc); + wifi.on("wifiStateChange", recvPowerNotifyFunc); // Unregister event - wifi.off(WIFI_POWER_STATE, recvPowerNotifyFunc); + wifi.off("wifiStateChange", recvPowerNotifyFunc); ```