1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-02-03 23:23:09 +00:00
Classworks/assets/VForm-D0L66uox.js

2 lines
781 B
JavaScript

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