提交 ca48f93f 编写于 作者: Q qiang

fix: input prevent submit

上级 e243f654
......@@ -114,6 +114,7 @@ export default /*#__PURE__*/ defineBuiltInComponent({
type={type.value}
maxlength={state.maxlength}
step={step.value}
// @ts-ignore
enterkeyhint={props.confirmType}
class="uni-input-input"
autocomplete="off"
......@@ -132,7 +133,11 @@ export default /*#__PURE__*/ defineBuiltInComponent({
{props.placeholder}
</div>
{props.confirmType === 'search' ? (
<form action="" onSubmit={() => false} class="uni-input-form">
<form
action=""
onSubmit={(event) => event.preventDefault()}
class="uni-input-form"
>
{inputNode}
</form>
) : (
......
......@@ -3110,7 +3110,7 @@ var Input = /* @__PURE__ */ defineBuiltInComponent({
"class": ["uni-input-placeholder", props2.placeholderClass]
}), [props2.placeholder], 16), [[vue.vShow, !(state.value.length || !valid.value)]]), props2.confirmType === "search" ? vue.createVNode("form", {
"action": "",
"onSubmit": () => false,
"onSubmit": (event) => event.preventDefault(),
"class": "uni-input-form"
}, [inputNode], 40, ["onSubmit"]) : inputNode])], 512);
};
......
......@@ -4883,7 +4883,7 @@ var Input = /* @__PURE__ */ defineBuiltInComponent({
"class": ["uni-input-placeholder", props2.placeholderClass]
}), [props2.placeholder], 16), [[vShow, !(state2.value.length || !valid.value)]]), props2.confirmType === "search" ? createVNode("form", {
"action": "",
"onSubmit": () => false,
"onSubmit": (event) => event.preventDefault(),
"class": "uni-input-form"
}, [inputNode], 40, ["onSubmit"]) : inputNode])], 512);
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册