1# ArkUI Subsystem Changelog 2## cl.arkui.1 Resource Type Support Added for Navigation and NavDestination Components' title and menus APIs 3**Access Level** 4 5Public API 6 7**Reason for Change** 8 9This change is made for enhancement of basic capabilities. 10 11**Change Impact** 12 13This change is a non-compatible change. 14 15After the type of **NavigationMenuItem** changes to string | Resource, it no longer matches a single variable type of string. Therefore, assigning **NavigationMenuItem** to a string type variable will result in a compilation error. 16 17``` 18@State myString: string = ''; 19@State myIcon: NavigationMenuItem["value"] = $r("app.string.MyTestMenuValue1") 20 21this.myString = this.myIcon 22``` 23 24**Start API Level** 25 269 27 28**Change Since** 29 30OpenHarmony SDK 5.0.0.42 31 32**Key API/Component Changes** 33 34Navigation/NavDestination 35 36**Adaptation Guide** 37 38``` 39// navigation.ets 40// Assign Resource type values to the title and menu APIs of Navigation or NavDestination. 41Navigation() { 42 // xxx 43} 44.title($r('app.string.MyTestNavigationTitle')) // Resource type values can be directly passed to the title API. 45// The item settings within menus directly support Resource type values. 46.menus([ 47 { 48 value: $r("app.string.MyTestMenuValue1"), 49 icon: $r("app.media.1") 50 }, 51 { 52 value: $r("app.string.MyTestMenuValue2"), 53 icon: $r("app.media.2") 54 }, 55 { 56 value: $r("app.string.MyTestMenuValue3"), 57 icon: $r("app.media.3") 58 } 59]) 60``` 61 62 63``` 64// navDestination.ets 65// The CommonTitle type of Navigation and NavDestination supports Resource type settings. 66@State commonTitle: NavDestinationCommonTitle = { main: $r('app.string.MyTestNavigationTitle'), sub: $r('app.string.MyTestNavigationTitle')} 67NavDestination() { 68 // xxx 69} 70.menus([ 71 { 72 value: $r("app.string.MyTestMenuValue1"), 73 icon: $r("app.media.4") 74 }, 75 { 76 value: $r("app.string.MyTestMenuValue2"), 77 icon: $r("app.media.5") 78 }, 79 { 80 value: $r("app.string.MyTestMenuValue3"), 81 icon: $r("app.media.6") 82 } 83]) 84.title(this.commonTitle) 85``` 86