uni-app:获取手机设备的系统信息(hbuilderx 3.7.3)

一,官方文档地址:

https://uniapp.dcloud.net.cn/api/system/info.html#

说明:刘宏缔的架构森林是一个专注架构的博客,

网站:https://blog.imgtouch.com
原文: https://blog.imgtouch.com/index.php/2023/06/05/uniapp-huo-qu-shou-ji-she-bei-de-xi-tong-xin-xi-hbuilderx-3/

         对应的源码可以访问这里获取: https://github.com/liuhongdi/
         或: https://gitee.com/liuhongdi

说明:作者:刘宏缔 邮箱: 371125307@qq.com

二,代码:

复制代码
<template>
    <view>
        <view v-for="(item, index) in res" :key="index" >
            {{index}}:{{item}}
        </view>
    </view>
</template>

<script>
    export default {
        data() {
            return {
                res:{},
            }
        },
        onLoad(){
            this.getSystemInfo();
        },
        methods: {
            getSystemInfo(){
               let that = this;
               uni.getSystemInfo({
                   success: function (res) {
                       console.log(res);
                       that.res = res;
                   }
                });
            }
        }
    }
</script>
<style>
</style>
复制代码

三,测试效果

四,查看hbuilderx的版本: 

 

posted @   刘宏缔的架构森林  阅读(483)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】
历史上的今天:
2021-02-25 spring boot:为service类做参数化单元测试(spring boot 2.4.3)
2020-02-25 centos8安装sersync为rsync实现实时同步
2020-02-25 rsync安装使用中出现的报错
2020-02-25 centos8环境安装配置rsync
2020-02-25 nfs4使用中的防火墙配置
2020-02-25 centos8安装及配置nfs4
点击右上角即可分享
微信分享提示