From d207edd9b91c7c1628abfb38f9ff4751bf8ef89f Mon Sep 17 00:00:00 2001 From: fangyunzhong Date: Mon, 7 Nov 2022 15:28:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangyunzhong --- .../reference/apis/js-apis-resource-manager.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md b/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md index b1ad40aa1b..9bda491c73 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-resource-manager.md @@ -1,6 +1,6 @@ # 资源管理 -资源管理模块,根据当前configuration(语言,区域,横竖屏,mccmnc)和device capability(设备类型,分辨率)提供获取应用资源信息读取接口。 +资源管理模块,根据当前configuration:语言、区域、横竖屏、Mcc(移动国家码)和Mnc(移动网络码)、Device capability(设备类型)、Density(分辨率)提供获取应用资源信息读取接口。 > **说明:** > @@ -16,9 +16,16 @@ import resourceManager from '@ohos.resourceManager'; ## 使用说明 从API Version9开始,Stage模型支持了通过context获取resourceManager对象的方式,再调用其内部获取资源的接口,无需再导入包,此方式FA模型不适用。 +Stage模型下Context的引用方法请参考[Stage模型的Context详细介绍](../../ability/context-userguide.md) ```ts -this.context.resourceManager; +import Ability from '@ohos.application.Ability'; +class MainAbility extends Ability { + onWindowStageCreate(windowStage) { + let context = this.context; + let resourceManager = context.resourceManager; + } +} ``` ## resourceManager.getResourceManager -- GitLab