在组件的 .ets 文件中,通过 $r('app.string.xxx') 的方式来引用字符串资源。例如:@Entry @Component struct MyComponent { build() { Column() { Text($r('app.string.app_name')) Text($r('app.string.welcome_message')) } } }
在组件的 .ets 文件中,通过 $r('app.string.xxx') 的方式来引用字符串资源。例如: