出来是这样的:
相关代码:
wxml:
<button class="add_btn" bindtap="showDialog" style="margin-left: 20%; opacity: 0.50; filter: alpha(opacity=80);">添加订单</button>
<van-dialog
use-slot
title="添加订单"
show="{{ show }}"
show-cancel-button
confirm-button-open-type="getUserInfo"
bind:close="onClose"
bind:getuserinfo="getUserInfo"
>
</van-dialog>
js:
data: {
show: false,
value: 0,
},
onChange(event) {
this.setData({
value: event.detail,
});
},
showDialog(){
this.setData({ show: true});
},
getUserInfo(event) {
console.log(event.detail);
},
onClose() {
this.setData({ show: false });
},