// components/dialog/dialog.js
Component({

    /**
     * 组件的属性列表
     */
    properties: {
        showDialog:{
            type: Boolean,
            value:false,
            observer(newval) {
              this.setData({
                showDialog: newval
              });
            },
          },
          message:{
            type: String,
            value: '22',
            observer(newval) {
              this.setData({
                message: newval,
              });
            },
          },
          showTip:{
            type: Boolean,
            value: false,
            observer(newval) {
              this.setData({
                showTip: newval
              });
            },
          },
          showCancel:{
            type: Boolean,
            value: true,
            observer(newval) {
              this.setData({
                showCancel: newval,
              });
            },
          },
          title:{
            type: String,
            value: '温馨提示',
            observer(newval) {
              this.setData({
                title: newval,
              });
            },
          },
        cancelText:{
            type: String,
            value: '取消',
            observer(newval) {
              this.setData({
                cancelText: newval,
              });
            },
          },
          confirmText:{
            type: String,
            value: '确定',
            observer(newval) {
              this.setData({
                confirmText: newval,
              });
            },
          },
    },

    /**
     * 组件的初始数据
     */
    data: {
       
    },

    /**
     * 组件的方法列表
     */
    methods: {
        onConfirm(){
            this.triggerEvent("confirm")
        },
        onCancel(){
           this.triggerEvent("cancel")
        }
    }
})