diff --git a/zh-cn/application-dev/reference/apis/js-apis-uri.md b/zh-cn/application-dev/reference/apis/js-apis-uri.md index c15f3ae77155fc6d876e74fd5421c7b25cbab041..6b2182c3af95ad7240f643a2d11e6526a823c695 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-uri.md +++ b/zh-cn/application-dev/reference/apis/js-apis-uri.md @@ -6,19 +6,16 @@ ## 导入模块 -``` +```js import uri from '@ohos.uri' ``` -## 系统能力 - -SystemCapability.Utils.Lang - ## URI - ### 属性 +**系统能力:** SystemCapability.Utils.Lang + | 名称 | 参数类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | | scheme | string | 是 | 否 | 获取URI 的协议部分。 | @@ -38,11 +35,13 @@ constructor(uri: string) constructor是URI的构造函数。 +**系统能力:** SystemCapability.Utils.Lang + **参数:** | 参数名 | 类型 | 可读 | 可写 | 说明 | | -------- | -------- | -------- | -------- | -------- | -| url | string | 是 | 是 | 入参对象。 | +| uri | string | 是 | 是 | 入参对象。 | **示例:** @@ -59,6 +58,8 @@ new uri.URI('http://username:password@host:8080'); // Output 'http://username:pa toString(): string +**系统能力:** SystemCapability.Utils.Lang + 返回适用于URL中的查询字符串。 **返回值:** @@ -70,7 +71,7 @@ toString(): string **示例:** ```js -const url = new uri.URL('http://username:password@host:8080/directory/file?query=pppppp#qwer=da'); +const url = new uri.URI('http://username:password@host:8080/directory/file?query=pppppp#qwer=da'); url.toString() ``` @@ -81,6 +82,8 @@ equals(other: URI): boolean 判断此URI是否与其他URI对象相等。 +**系统能力:** SystemCapability.Utils.Lang + **参数:** | 参数名 | 类型 | 必填 | 说明 | @@ -107,6 +110,8 @@ checkIsAbsolute(): boolean 判断此URI是否为绝对URI(是否定义了scheme组件)。 +**系统能力:** SystemCapability.Utils.Lang + **返回值:** | 类型 | 说明 | @@ -127,6 +132,8 @@ normalize(): URI 规范化此URI的路径。 +**系统能力:** SystemCapability.Utils.Lang + **返回值:** | 类型 | 说明 |