提交 9f735502 编写于 作者: 杜庆泉's avatar 杜庆泉

Update uts-plugin.md

上级 6c4fc54f
...@@ -451,6 +451,22 @@ import * as UTSHello from "../../../uni_modules/uts-osapi"; ...@@ -451,6 +451,22 @@ import * as UTSHello from "../../../uni_modules/uts-osapi";
UTSHello.getBatteryCapacity() UTSHello.getBatteryCapacity()
``` ```
**特别注意**
需要特别注意的是,import UTS插件时,只能到插件的根目录,不能直接引入到最终的文件
```
// 正确的写法
import * as UTSHello from "../../../uni_modules/uts-osapi";
```
```
// 错误的写法
import * as UTSHello from "../../../uni_modules/uts-osapi/index.uts";
```
**显性引用** **显性引用**
...@@ -466,6 +482,8 @@ import { ...@@ -466,6 +482,8 @@ import {
getBatteryCapacity() getBatteryCapacity()
``` ```
关于电量这个插件,插件市场已经提供好了现成的插件,除了Android,还同时支持了web和小程序,可以去下载体验。[详见](https://ext.dcloud.net.cn/plugin?id=9295) 关于电量这个插件,插件市场已经提供好了现成的插件,除了Android,还同时支持了web和小程序,可以去下载体验。[详见](https://ext.dcloud.net.cn/plugin?id=9295)
更多开发示例,可以参考 [HelloUTS](https://gitcode.net/dcloud/hello-uts) 更多开发示例,可以参考 [HelloUTS](https://gitcode.net/dcloud/hello-uts)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册