js
ElMessageBox.prompt('', '验证取货码', {
inputPattern: /^.{1,20}$/,
inputErrorMessage: '请输入取货码',
inputPlaceholder: '请输入取货码',
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
if (instance.inputValue) {
let flag = false;
if (flag) {
done()
} else {
ElMessage.error('取货码错误');
return
}
}
}
done();
}
});