vue 自定义弹框的用法
一、$prompt 的用法

  console.log('驳回的参数',list);
      this.$prompt('', '原因', {
        inputType: 'textarea',
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        inputPattern: /\S/,
        inputErrorMessage: '原因不能为空',
        inputValidator: (value) => {
          // 点击按钮时,对文本框里面的值进行验证
          if(!value) {
            return inputErrorMessage;
          }
        }
      }).then(({ value }) => {
        console.log('输入框的值',value);
      }).catch(() => {

      })

二、$confirm 的用法

 this.$confirm(`此操作将归为失败, 是否继续?`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        // do
      }).catch(() => {

      })
Logo

前往低代码交流专区

更多推荐