mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2025-12-07 21:13:11 +00:00
2 lines
785 B
JavaScript
2 lines
785 B
JavaScript
import{g as p,p as v,$ as b,c as y,i as F,n as V,e as h,ad as R,h as P}from"./index-DCfuJPuG.js";import{i as k,j as C}from"./VTextField-BRbhN_Cz.js";const S=v({...P(),...C()},"VForm"),D=p()({name:"VForm",props:S(),emits:{"update:modelValue":o=>!0,submit:o=>!0},setup(o,i){let{slots:s,emit:l}=i;const r=k(o),n=b();function f(t){t.preventDefault(),r.reset()}function u(t){const a=t,e=r.validate();a.then=e.then.bind(e),a.catch=e.catch.bind(e),a.finally=e.finally.bind(e),l("submit",a),a.defaultPrevented||e.then(c=>{var m;let{valid:d}=c;d&&((m=n.value)==null||m.submit())}),a.preventDefault()}return y(()=>{var t;return F("form",{ref:n,class:h(["v-form",o.class]),style:V(o.style),novalidate:!0,onReset:f,onSubmit:u},[(t=s.default)==null?void 0:t.call(s,r)])}),R(r,n)}});export{D as V};
|