diff --git a/zh-cn/application-dev/key-features/multi-device-app-dev/responsive-layout.md b/zh-cn/application-dev/key-features/multi-device-app-dev/responsive-layout.md index ce5f47f69eeb3459efd9feb3ca58a73b9046bccb..816555e7a5eab6740cc5e6d211fcba245e2bd285 100644 --- a/zh-cn/application-dev/key-features/multi-device-app-dev/responsive-layout.md +++ b/zh-cn/application-dev/key-features/multi-device-app-dev/responsive-layout.md @@ -230,9 +230,15 @@ export class BreakpointSystem { } public unregister() :void{ - this.smListener.off("change", this.isBreakpointSM) - this.mdListener.off("change", this.isBreakpointMD) - this.lgListener.off("change", this.isBreakpointLG) + if(this.smListener){ + this.smListener.off("change", this.isBreakpointSM) + } + if(this.mdListener){ + this.mdListener.off("change", this.isBreakpointMD) + } + if(this.lgListener){ + this.lgListener.off("change", this.isBreakpointLG) + } } } diff --git a/zh-cn/application-dev/key-features/multi-device-app-dev/settings-application-page.md b/zh-cn/application-dev/key-features/multi-device-app-dev/settings-application-page.md index 1e8364e1a503aaf874e52f2fbc43cb004575f4a5..6740b70ada0af92fac463010118df0be831cb976 100644 --- a/zh-cn/application-dev/key-features/multi-device-app-dev/settings-application-page.md +++ b/zh-cn/application-dev/key-features/multi-device-app-dev/settings-application-page.md @@ -60,6 +60,12 @@ struct Index { ``` ```typescript //核心代码 SettingList.ets +import { MainItem } from '../components/MainItem' +import { ItemGroup } from '../components/ItemGroup' +import { SearchBox } from '../components/SearchBox' +import { MoreConnectionsItem } from '../moreconnections/MoreConnectionsItem' +import { WlanSettingItem } from '../wlan/WlanSettingItem' + class ItemObj { title?: Resource tag?: string @@ -114,13 +120,7 @@ let aboutTab:ItemObj={ title: $r('app.string.aboutTab'), icon: $r('app.media.aboutDevice'), } - -import { MainItem } from '../components/MainItem' -import { ItemGroup } from '../components/ItemGroup' -import { SearchBox } from '../components/SearchBox' -import { MoreConnectionsItem } from '../moreconnections/MoreConnectionsItem' -import { WlanSettingItem } from '../wlan/WlanSettingItem' - + @Component export struct SettingList { @Builder