效果
wxml
<button type="primary" form-type='submit'>登录</button>
wxss
添加如下样式:
button[type="primary"] { display:flex; align-items: center; justify-content: center; }
所有样式如下:
button[type="primary"] { display:flex; align-items: center; justify-content: center; height: 40px; line-height: 40px; font-size: 36rpx; text-align: center; background-color: #007AFF !important; margin-top: 20px; margin-bottom: 20px; color: #FFFFFF; border-radius: 10px; }
效果如下