提示框提交内容时,进行校验的写法!
this.$prompt('Reason:', 'To Operation Agent', {
2 showCancelButton: true,
3 showInput: true,
4 inputType: 'textarea',
5 inputValue: "",
6 inputValidator: value => {
7 if (value === "") {
8 return true;
9 }
10 return !(value.length > 10);
11 },
12 inputErrorMessage: 'input maxLength is 10!',
13 beforeClose:(action, instance, done)=> {
14 if (action==='confirm'){
15 alert("1111");
16 }
17 done();
18
19 }
20 }).then(() => {
21 this.$message({
22 type: 'success',
23 message: '已驳回'
24 });
25 }).catch(() => {
26 this.$message({
27 type: 'info',
28 message: '已取消'
29 });
30 });