1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-02-04 07:53:11 +00:00
Classworks/assets/VForm-Jb3Esqve.js

2 lines
786 B
JavaScript

import{g as p,p as b,b as v,i as h,n as y,d as F,a0 as V,aw as R,h as P}from"./index-Ck0Pnd4f.js";import{h as k,i as C}from"./VTextField-C6VOv1Py.js";const S=b({...P(),...C()},"VForm"),z=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 v(()=>{var t;return h("form",{ref:n,class:F(["v-form",o.class]),style:y(o.style),novalidate:!0,onReset:f,onSubmit:u},[(t=s.default)==null?void 0:t.call(s,r)])}),R(r,n)}});export{z as V};