layer.confirm添加输入框
时间: 2023-10-24 18:26:28 浏览: 244
确认框confirm的使用
layer.confirm添加输入框的方法是通过在layer.confirm的配置参数中使用prompt属性来实现的。具体的代码可以如下所示:
layer.confirm('请输入密码', {
title: '密码确认',
btn: ['确定', '取消'],
prompt: {
placeholder: '请输入密码',
type: 'password'
}
}, function(value, index, elem) {
// 输入框的确认回调函数
console.log(value); // 获取输入框的值
layer.close(index); // 关闭确认框
}, function() {
// 取消按钮的回调函数
layer.close(index); // 关闭确认框
});<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [layer 实现弹窗提交信息](https://blog.csdn.net/antony9118/article/details/53575597)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [Layui之layer.confirm询问框,是否重置](https://blog.csdn.net/weixin_53406687/article/details/121849310)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文