手动触发html校验submit, 校验不通过不提交
https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement
this.editing.dom.container.querySelector('form input[type="submit"]').click(); let inValid = true; [].forEach.call(this.editing.dom.container.querySelectorAll('form input[required]'), (input) => { if (input.checkValidity() === false) { inValid = false; } }); if (!inValid) { return; }
欢迎指正批评!!!