this.$prompt('请输入名称:', '提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type:"warning", // 图标样式"warning"|"error"...
inputValue: '输入框默认值',
inputErrorMessage: '输入不能为空',
inputValidator: (value) => { // 点击按钮时,对文本框里面的值进行验证
if(!value) {
return '输入不能为空';
}
},
}).then(({value}) => {
// TO DO DO ...
}).catch((err) => {
this.$message({
type: 'info',
message: '取消输入'
});
});
element-ui $prompt输入弹框
最新推荐文章于 2024-06-25 14:42:26 发布