<template><view><page-head:title="title"></page-head><viewclass="uni-common-mt"><viewclass="uni-list"><viewclass="uni-list-cell"v-for="(item,_) in items"style="align-items: center;"><viewclass="uni-pd"><viewclass="uni-label"style="width:180px;">{{item.label}}</view></view><viewclass="uni-list-cell-db"><textarea:auto-height="true":disabled="true"placeholder="未获取":value="item.value"/></view></view></view><viewclass="uni-padding-wrap"><viewclass="uni-btn-v"><buttontype="primary"@tap="getAppBaseInfo">获取App基础信息</button></view></view></view></view></template><script>
type Item ={label: string,value: string,}exportdefault{data(){return{title:'getAppBaseInfo',items:[]as Item[],}},onUnload:function(){},methods:{getAppBaseInfo:function(){const res = uni.getAppBaseInfo();this.items =[]as Item[];for(const key in res){const value = res[key];if(value !=null){const item ={label: key,value:""+((typeof value =="object")?JSON.stringify(value): value)}as Item;this.items.push(item);}}}}}</script><style>.uni-pd{padding-left: 30rpx;}</style>