@vunk/form 1.1.42 → 1.1.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/components/form/index.js
CHANGED
|
@@ -60,7 +60,8 @@ const props = __spreadProps$1(__spreadValues$1({}, formProps), {
|
|
|
60
60
|
const createBindProps = bindPropsFactory(props);
|
|
61
61
|
const emits = __spreadProps$1(__spreadValues$1({}, formEmits), {
|
|
62
62
|
setData: (e) => e,
|
|
63
|
-
validate: null
|
|
63
|
+
validate: null,
|
|
64
|
+
submit: null
|
|
64
65
|
});
|
|
65
66
|
const createOnEmits = onEmitsFactory(emits);
|
|
66
67
|
|
|
@@ -173,13 +174,18 @@ const _sfc_main = defineComponent({
|
|
|
173
174
|
}
|
|
174
175
|
return props2.formItems;
|
|
175
176
|
});
|
|
177
|
+
const handleSubmit = (e) => {
|
|
178
|
+
e.preventDefault();
|
|
179
|
+
emit("submit", e);
|
|
180
|
+
};
|
|
176
181
|
return {
|
|
177
182
|
formProps,
|
|
178
183
|
formEmits,
|
|
179
184
|
getValue,
|
|
180
185
|
getRef,
|
|
181
186
|
computed,
|
|
182
|
-
rendererSource
|
|
187
|
+
rendererSource,
|
|
188
|
+
handleSubmit
|
|
183
189
|
};
|
|
184
190
|
}
|
|
185
191
|
});
|
|
@@ -194,7 +200,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
194
200
|
}
|
|
195
201
|
}, _ctx.formProps, toHandlers(_ctx.formEmits), {
|
|
196
202
|
model: _ctx.model || _ctx.data,
|
|
197
|
-
ref: _ctx.getRef
|
|
203
|
+
ref: _ctx.getRef,
|
|
204
|
+
onSubmit: _ctx.handleSubmit
|
|
198
205
|
}), {
|
|
199
206
|
default: withCtx(() => [
|
|
200
207
|
createVNode(_component_VkfFormItemRenderer, { source: _ctx.rendererSource }, {
|
|
@@ -211,7 +218,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
211
218
|
renderSlot(_ctx.$slots, "default")
|
|
212
219
|
]),
|
|
213
220
|
_: 3
|
|
214
|
-
}, 16, ["class", "model"]);
|
|
221
|
+
}, 16, ["class", "model", "onSubmit"]);
|
|
215
222
|
}
|
|
216
223
|
var VkfForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__file", "index.vue"]]);
|
|
217
224
|
|
|
@@ -387,8 +387,10 @@ export declare const createBindProps: <T2 extends import("@vunk/core").NormalObj
|
|
|
387
387
|
export declare const emits: {
|
|
388
388
|
setData: (e: SetDataEvent) => SetDataEvent<any>;
|
|
389
389
|
validate: null;
|
|
390
|
+
submit: null;
|
|
390
391
|
};
|
|
391
|
-
export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("validate" | "setData")[] | undefined>(emit: T2, excludes?: EX | undefined) => { [P in EX extends (infer KE)[] ? Exclude<"validate", KE> | Exclude<"setData", KE> : "validate" | "setData"]: {
|
|
392
|
+
export declare const createOnEmits: <T2 extends import("@vunk/core").AnyFunc, EX extends ("submit" | "validate" | "setData")[] | undefined>(emit: T2, excludes?: EX | undefined) => { [P in EX extends (infer KE)[] ? Exclude<"submit", KE> | Exclude<"validate", KE> | Exclude<"setData", KE> : "submit" | "validate" | "setData"]: {
|
|
392
393
|
setData: (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
393
394
|
validate: (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
395
|
+
submit: (...e: import("@vunk/core").RestParameters<T2>) => void;
|
|
394
396
|
}[P]; };
|
|
@@ -53,7 +53,8 @@ const props = __spreadProps(__spreadValues({}, formProps), {
|
|
|
53
53
|
const createBindProps = bindPropsFactory(props);
|
|
54
54
|
const emits = __spreadProps(__spreadValues({}, formEmits), {
|
|
55
55
|
setData: (e) => e,
|
|
56
|
-
validate: null
|
|
56
|
+
validate: null,
|
|
57
|
+
submit: null
|
|
57
58
|
});
|
|
58
59
|
const createOnEmits = onEmitsFactory(emits);
|
|
59
60
|
|
|
@@ -393,9 +393,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
393
393
|
getRef: (e: InstanceType<typeof ElForm>) => void;
|
|
394
394
|
computed: typeof import("@vue/reactivity").computed;
|
|
395
395
|
rendererSource: import("vue").ComputedRef<any>;
|
|
396
|
+
handleSubmit: (e: Event) => void;
|
|
396
397
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
397
398
|
setData: (e: import("@vunk/core").SetDataEvent<any>) => import("@vunk/core").SetDataEvent<any>;
|
|
398
399
|
validate: null;
|
|
400
|
+
submit: null;
|
|
399
401
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
400
402
|
data: {
|
|
401
403
|
type: import("vue").PropType<Record<string, any>>;
|
|
@@ -767,6 +769,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
767
769
|
}>> & {
|
|
768
770
|
onSetData?: ((e: import("@vunk/core").SetDataEvent<any>) => any) | undefined;
|
|
769
771
|
onValidate?: ((...args: any[]) => any) | undefined;
|
|
772
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
770
773
|
}, {
|
|
771
774
|
labelWidth: import("element-plus/es/utils").EpPropMergeType<readonly [StringConstructor, NumberConstructor], unknown, unknown>;
|
|
772
775
|
inlineMessage: boolean;
|