tmagic-editor/docs/assets/api_form_form-dialog-events.md.D6XTQ524.js
2026-07-10 08:46:09 +00:00

10 lines
4.6 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{ax as a,z as i,A as e,b5 as n}from"./chunks/framework.DRScawWW.js";const k=JSON.parse('{"title":"FormDialog组件 events","description":"","frontmatter":{},"headers":[],"relativePath":"api/form/form-dialog-events.md","filePath":"api/form/form-dialog-events.md"}'),t={name:"api/form/form-dialog-events.md"};function l(r,s,o,h,p,d){return e(),i("div",null,[...s[0]||(s[0]=[n(`<h1 id="formdialog组件-events" tabindex="-1">FormDialog组件 events <a class="header-anchor" href="#formdialog组件-events" aria-label="Permalink to “FormDialog组件 events”"></a></h1><h2 id="close" tabindex="-1">close <a class="header-anchor" href="#close" aria-label="Permalink to “close”"></a></h2><ul><li><p><strong>详情:</strong> 弹出关闭</p></li><li><p><strong>事件回调函数:</strong> <code>() =&gt; void</code></p></li></ul><h2 id="submit" tabindex="-1">submit <a class="header-anchor" href="#submit" aria-label="Permalink to “submit”"></a></h2><ul><li><p><strong>详情:</strong> 调用 <a href="./form-dialog-methods.html#save">save()</a> 校验通过后触发</p></li><li><p><strong>事件回调函数:</strong> <code>(values: any, eventData: { changeRecords: ChangeRecord[] }) =&gt; void</code></p></li></ul><h2 id="error" tabindex="-1">error <a class="header-anchor" href="#error" aria-label="Permalink to “error”"></a></h2><ul><li><p><strong>详情:</strong> 表单校验<strong>不</strong>通过时触发</p></li><li><p><strong>事件回调函数:</strong> <code>(invalidFields: Record&lt;string, { message: string; field: string }[]&gt;) =&gt; void</code></p><p>注意:与 <code>Form</code> 的 <code>error</code> 事件一致,回调收到的是 element-plus <code>validate</code> 返回的 <code>invalidFields</code> 结构,<strong>不是</strong> <code>Error</code> 实例。</p></li></ul><h2 id="change" tabindex="-1">change <a class="header-anchor" href="#change" aria-label="Permalink to “change”"></a></h2><ul><li><p><strong>详情:</strong> 表单中任何值发生变化</p></li><li><p><strong>事件回调函数:</strong> <code>(values: any, eventData: ContainerChangeEventData) =&gt; void</code></p><p>注意:第一个参数是<strong>整张表单</strong>的 <code>values</code>,并非单个字段的值。</p><p>其中 <code>ContainerChangeEventData</code> 定义如下:</p><div class="language-ts"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e;" tabindex="0" dir="ltr"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">interface</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ChangeRecord</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> propPath</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> value</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> any</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span>
<span class="line"></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">interface</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ContainerChangeEventData</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> {</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> modifyKey</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">;</span></span>
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70;"> changeRecords</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> ChangeRecord</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">[];</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">}</span></span></code></pre></div></li></ul>`,9)])])}const c=a(t,[["render",l]]);export{k as __pageData,c as default};