Mint-ui MessageBox.prompt配置

xiaoxiao2021-02-27  251

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) })
转载请注明原文地址: https://www.6miu.com/read-11008.html

最新回复(0)