zoukankan      html  css  js  c++  java
  • mintUI之MessageBox表单验证

    <div class="mobileTrainActivityDetailButton_css">
    	<mt-button v-if="path=='/mobileMyTrains'?true:false" @click.native="leave" size="large"> 请假 </mt-button>
    </div>
    
    //方法体里面
    leave() {
       MessageBox.prompt('请假理由', { inputValidator: (val) => { if (val === null) {    return true;//初始化的值为null,不做处理的话,刚打开MessageBox就会校验出错,影响用户体验 } return !(val.length < 100)   }, inputErrorMessage: '不能小于100字' }).then((val) => { this.loading = true; var leaveForm = { trainId: this.trainInfo.trainId, leaveFlow: this.trainInfo.leaveFlow, leaveReason: val, }; this.postRequest("/tmsproxy/trainLeave", leaveForm).then(resp => { this.loading = false; if(resp.data.status == "success") { MessageBox.alert(resp.data.msg, ""); } }) }, () => { console.info('cancel') }) }

      

  • 相关阅读:
    Android SDK镜像的介绍使用
    如何在使用MAMP环境下安装MySQLdb
    MySQL – 导出数据成csv
    CSV
    自己写的一个Yeoman的Generator-Require-Angularjs
    笔记
    PHP
    Intellij IDEA 14的注册机
    nodejs
    Python
  • 原文地址:https://www.cnblogs.com/zhengyuanyuan/p/10757328.html
Copyright © 2011-2022 走看看