更新小程序仓库
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
// components/dialog/dialog.js
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
showDialog: {
|
||||
type: Boolean,
|
||||
value: false,
|
||||
observer(newval) {
|
||||
this.setData({
|
||||
showDialog: newval,
|
||||
});
|
||||
},
|
||||
},
|
||||
message:{
|
||||
type: String,
|
||||
value: '',
|
||||
observer(newval) {
|
||||
this.setData({
|
||||
message: newval,
|
||||
});
|
||||
},
|
||||
},
|
||||
cancelBtn:{
|
||||
type: Boolean,
|
||||
value: true,
|
||||
observer(newval) {
|
||||
this.setData({
|
||||
cancelBtn: newval,
|
||||
});
|
||||
},
|
||||
},
|
||||
dialogTitle:{
|
||||
type: String,
|
||||
value: '温馨提示',
|
||||
observer(newval) {
|
||||
this.setData({
|
||||
dialogTitle: newval,
|
||||
});
|
||||
},
|
||||
},
|
||||
confirmColor:{
|
||||
type: String,
|
||||
value: '#3CC7C0',
|
||||
observer(newval) {
|
||||
this.setData({
|
||||
confirmColor: newval,
|
||||
});
|
||||
},
|
||||
},
|
||||
canceltext:{
|
||||
type: String,
|
||||
value: '取消',
|
||||
observer(newval) {
|
||||
this.setData({
|
||||
canceltext: newval,
|
||||
});
|
||||
},
|
||||
},
|
||||
confirmtext:{
|
||||
type: String,
|
||||
value: '确定',
|
||||
observer(newval) {
|
||||
this.setData({
|
||||
confirmtext: newval,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
showDialog: false,
|
||||
message:'',
|
||||
confirmColor:'#3CC7C0',
|
||||
dialogTitle:"温馨提示",
|
||||
cancelBtn:true,
|
||||
canceltext:'取消',
|
||||
confirmtext:'确定'
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
onConfirm() {
|
||||
this.setData({ showDialog: false });
|
||||
this.triggerEvent("confirm",true)
|
||||
},
|
||||
|
||||
onClose() {
|
||||
this.setData({ showDialog: false });
|
||||
this.triggerEvent("close",true)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-dialog": "@vant/weapp/dialog/index"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<!--components/dialog/dialog.wxml-->
|
||||
<van-dialog id="van-dialog" title="{{dialogTitle}}" message="{{message}}" show-cancel-button="{{cancelBtn}}" cancel-button-text="{{canceltext}}" confirm-button-text="{{confirmtext}}" confirm-button-color="{{confirmColor}}" bind:confirm="onConfirm" cancle-button-class="cancelBtn" custom-class="my-class"
|
||||
bind:cancel="onClose" show="{{showDialog}}" use-cancel-button-slot>
|
||||
<view slot="cancel-button">333</view>
|
||||
</van-dialog>
|
||||
@@ -0,0 +1,4 @@
|
||||
/* components/dialog/dialog.wxss */
|
||||
.van-dialog__cancel{
|
||||
border: 1px solid rgba(0,0,0,0.1)!important;
|
||||
}
|
||||
Reference in New Issue
Block a user