Mint-ui MessageBox.prompt配置

来源:互联网 发布:淘宝购物漏洞 编辑:程序博客网 时间:2024/06/07 20:57

Mint-ui 弹框配置

官方文档描述不清晰,复制粘贴效果不理想,最后看源码,找配置解决
MessageBox.prompt('请输入姓名').then(({ value, action }) => {  ...});MessageBox.prompt(message, title);// 以上文档里只写了两个参数,明显不能满足需要,试了半天效果不理想,果断看源码// 以下源码// 重点来了,第三项才是配置参数,完美解决MessageBox.prompt = function(message, title, options) {  if (typeof title === 'object') {    options = title;    title = '';  }  return MessageBox(merge({    title: title,    message: message,    showCancelButton: true,    showInput: true,    $type: 'prompt'  }, options));};// 测试代码MessageBox.prompt(' ', '测试', {inputPlaceholder: '测试文字'}).then(({ value, action }) => {  console.log(value)})
2 0