mirror of
https://github.com/ZeroCatDev/Classworks.git
synced 2025-12-08 05:26:51 +00:00
2 lines
785 B
JavaScript
2 lines
785 B
JavaScript
import{g as p,p as b,W as v,c as h,i as y,n as F,e as V,ab as R,h as P}from"./index-C_cLcCVv.js";import{h as k,i as C}from"./VTextField-CxhWxheo.js";const S=b({...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=v();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 h(()=>{var t;return y("form",{ref:n,class:V(["v-form",o.class]),style:F(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};
|