悬赏20元,找人帮解决在纯js页面使用elementUI弹出两个输入框的问题

纯js页面

纯js页面

纯js页面

http://element-cn.eleme.io/#/...

在纯js页面使用这个组件,弹出两个input输入框,获取输入的值

我的代码

import { MessageBox } from 'element-ui'

MessageBox('请输入邮箱', '提示', {
showInput: true,
inputValue: 'haha',
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /[\w!#$%&'* /=?^_{|}~-] (?:\.[\w!#$%&'* /=?^_{|}~-] )*@(?:\w?.) \w?/,
inputErrorMessage: '邮箱格式不正确'
}).then(({ value }) => {
console.log(value)
}).catch(() => {
})
}

但这样input框出不来,

阅读 3.7k
2 个回答

图片描述
图片描述
我的钱给出去了

https://github.com/ElemeFE/el...

this.$msgbox({
      title: '消息',
      // message: message,
      message: h('div', null, [
        h('el-input', {
            props: {
              value: this.value1,
          },
          on: {
              change: this.handleChange
          }
        })
      ]),
      showCancelButton: true,
      confirmButtonText: '确定',
      cancelButtonText: '取消'
    })

JSFiddle,未能复现你的问题。

看了你的代码,如要调用confirm prompt ,在单独引用时应该使用MessageBox.confirmMessageBox.prompt

clipboard.png

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题