未验证 提交 46b246bc 编写于 作者: Z zengyawen 提交者: Gitee

update zh-cn/application-dev/reference/apis/js-apis-uri.md.

Signed-off-by: Nzengyawen <zengyawen1@huawei.com>
上级 8f4b0000
...@@ -6,19 +6,16 @@ ...@@ -6,19 +6,16 @@
## 导入模块 ## 导入模块
``` ```js
import uri from '@ohos.uri' import uri from '@ohos.uri'
``` ```
## 系统能力
SystemCapability.Utils.Lang
## URI ## URI
### 属性 ### 属性
**系统能力:** SystemCapability.Utils.Lang
| 名称 | 参数类型 | 可读 | 可写 | 说明 | | 名称 | 参数类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| scheme | string | 是 | 否 | 获取URI&nbsp;的协议部分。 | | scheme | string | 是 | 否 | 获取URI&nbsp;的协议部分。 |
...@@ -38,11 +35,13 @@ constructor(uri: string) ...@@ -38,11 +35,13 @@ constructor(uri: string)
constructor是URI的构造函数。 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 ...@@ -59,6 +58,8 @@ new uri.URI('http://username:password@host:8080'); // Output 'http://username:pa
toString(): string toString(): string
**系统能力:** SystemCapability.Utils.Lang
返回适用于URL中的查询字符串。 返回适用于URL中的查询字符串。
**返回值:** **返回值:**
...@@ -70,7 +71,7 @@ toString(): string ...@@ -70,7 +71,7 @@ toString(): string
**示例:** **示例:**
```js ```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() url.toString()
``` ```
...@@ -81,6 +82,8 @@ equals(other: URI): boolean ...@@ -81,6 +82,8 @@ equals(other: URI): boolean
判断此URI是否与其他URI对象相等。 判断此URI是否与其他URI对象相等。
**系统能力:** SystemCapability.Utils.Lang
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
...@@ -107,6 +110,8 @@ checkIsAbsolute(): boolean ...@@ -107,6 +110,8 @@ checkIsAbsolute(): boolean
判断此URI是否为绝对URI(是否定义了scheme组件)。 判断此URI是否为绝对URI(是否定义了scheme组件)。
**系统能力:** SystemCapability.Utils.Lang
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
...@@ -127,6 +132,8 @@ normalize(): URI ...@@ -127,6 +132,8 @@ normalize(): URI
规范化此URI的路径。 规范化此URI的路径。
**系统能力:** SystemCapability.Utils.Lang
**返回值:** **返回值:**
| 类型 | 说明 | | 类型 | 说明 |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册