2024.06.24今天我学习了如何对提示框增加文本域的方法,效果如下:

代码如下:

<script>
      methods:{
       reject_event(){
           this.$prompt(`驳回内容`, '提示', {
             confirmButtonText: '确定',
             cancelButtonText: '取消',
             inputType: 'textarea',
             inputPlaceholder: '请填写驳回理由',
             customClass: 'custom-prompt',
             inputValidator: (value) => {
              if (!value) {
                return '请填写驳回理由'
                }
        },
              }).then(({ value }) => {
                   console.log(value ,'理由')
              }
            })
          }).catch(e => {
            return
          });
       }
     }
</script>

<style>
.custom-prompt .el-textarea__inner {
  height: 200px !important;
}
</style>

Logo

Agent 垂直技术社区,欢迎活跃、内容共建。

更多推荐