微信小程序学习笔记(button按钮)

button按钮样式部分
html<button size="default" type="default" plain="{{true}}">按钮</button>
size设置尺寸,type设置颜色、default黑色,warn红色,primary绿色,plain设置button是否镂空,背景色透明,loading属性设置button按钮内部是否显示加载图标
<button size="default" type="warn" plain="{{true}}">按钮</button>
<button size="default" type="primary" plain="{{true}}">按钮</button>
<button size="default" type="primary" plain="{{false}}" loading="{{true}}" >按钮</button>
button按钮open-type属性部分
<button open-type="contact">contact</button>
直接打开小程序的客服对话功能

<button open-type="share">share</button>
分享当前小程序到朋友,但是不能分享到朋友圈

<button open-type="getPhoneNumber" bindgetphonenumber="GetPhoneNumber">getPhoneNumber</button>
获取当前用户的手机号码,非企业小程序没有权限。获取需要绑定事件(bindgetphonenumber)来使用,在回调函数中通过参数来获取用户信息,获取到的信息会被加密呈现,需要在后台服务器解析再返回到小程序中

<button open-type="getUserInfo" bindgetuserinfo="getUserInfo">getUserInfo</button>
获取当前用户的用户信息
使用方法类似于获取手机号码,不加密

<button open-type="launchApp">launchApp</button>
小程序中直接打开APP
需要先在APP中通过APP的某个链接打开小程序,之后才能在小程序中返回APP

<button open-type="openSetting">openSetting</button>
打开小程序内置的授权页面
授权页面只会出现用户曾经同意过的权限

<button open-type="feedback">feedback</button>
打开小程序内置的意见反馈界面

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值