<template>
<view class="content">
<view class="con">
<!-- 用户头像 -->
<open-data type="userAvatarUrl" class="con-avatar"></open-data>
</view>
<view class="con">
<!-- 用户昵称 -->
<open-data type="userNickName" class="con-userNickName" lang="zh_CN"></open-data>
</view>
<!-- 用户性别 -->
<open-data type="userGender" lang="zh_CN"></open-data>
<!-- 用户所在省份 -->
<open-data type="userProvince" lang="zh_CN"></open-data>
<!-- 用户所在城市 -->
<open-data type="userCity" lang="zh_CN"></open-data>
<view class="">
<button open-type="openSetting" bindopensetting="callback">打开设置页</button>
</view>
</view>
</template>
微信小程序open-data使用
最新推荐文章于 2023-05-10 16:21:29 发布
本文介绍微信小程序中open-data组件的基本用法,通过实例展示了如何获取并展示用户的头像、昵称等信息,并提供了设置按钮的实现方式。

6224

被折叠的 条评论
为什么被折叠?



