提交 3df5c928 编写于 作者: 杜庆泉's avatar 杜庆泉

battery plugin release done

上级 4bc52919
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</view> </view>
</template> </template>
<script> <script>
import getBatteryInfo from "../../uni_modules/uni-getbatteryinfo"; import getBatteryInfo from "@/uni_modules/uni-getbatteryinfo";
export default { export default {
data() { data() {
......
## 1.0.0(2022-09-01)
实现android/web/微信小程序平台获取电量
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
"id": "uni-getbatteryinfo", "id": "uni-getbatteryinfo",
"displayName": "uni-getbatteryinfo", "displayName": "uni-getbatteryinfo",
"version": "1.0.0", "version": "1.0.0",
"description": "uni-getbatteryinfo", "description": "使用uts开发,实现在多个平台获取电量信息",
"keywords": [ "keywords": [
"uni-getbatteryinfo" "battery"
], ],
"repository": "", "repository": "",
"engines": { "engines": {
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
"qq": "" "qq": ""
}, },
"declaration": { "declaration": {
"ads": "", "ads": "",
"data": "", "data": "插件不采集任何数据",
"permissions": "" "permissions": ""
}, },
"npmurl": "" "npmurl": ""
}, },
...@@ -35,33 +35,35 @@ ...@@ -35,33 +35,35 @@
"encrypt": [], "encrypt": [],
"platforms": { "platforms": {
"cloud": { "cloud": {
"tcb": "u", "tcb": "y",
"aliyun": "u" "aliyun": "y"
}, },
"client": { "client": {
"Vue": { "Vue": {
"vue2": "u", "vue2": "n",
"vue3": "u" "vue3": "y"
}, },
"App": { "App": {
"app-android": "u", "app-android": {
"app-ios": "u" "minVersion": "21"
},
"app-ios": "n"
}, },
"H5-mobile": { "H5-mobile": {
"Safari": "u", "Safari": "y",
"Android Browser": "u", "Android Browser": "y",
"微信浏览器(Android)": "u", "微信浏览器(Android)": "y",
"QQ浏览器(Android)": "u" "QQ浏览器(Android)": "y"
}, },
"H5-pc": { "H5-pc": {
"Chrome": "u", "Chrome": "y",
"IE": "u", "IE": "y",
"Edge": "u", "Edge": "y",
"Firefox": "u", "Firefox": "y",
"Safari": "u" "Safari": "y"
}, },
"小程序": { "小程序": {
"微信": "u", "微信": "y",
"阿里": "u", "阿里": "u",
"百度": "u", "百度": "u",
"字节跳动": "u", "字节跳动": "u",
......
# uts-batteryinfo # uni-getbatteryinfo
### 开发文档
[UTS 语法](https://uniapp.dcloud.net.cn/tutorial/syntax-uts.html) ## 使用文档
[UTS 原生插件](https://uniapp.dcloud.net.cn/plugin/uts-plugin.html)
[Hello UTS](https://gitcode.net/dcloud/hello-uts/-/tree/dev) ```ts
\ No newline at end of file // 引用插件
import getBatteryInfo from "@/uni_modules/uni-getbatteryinfo";
// 获取电量信息
getBatteryInfo({
success(res) {
console.log(res);
uni.showToast({
title: "当前电量:" + res.level + '%',
icon: 'none'
});
}
})
```
{
"minSdkVersion": "21"
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册