tmagic-editor/docs/assets/api_table_methods.md.QkOCzJ6I.js
2025-12-11 11:05:26 +00:00

5 lines
5.0 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 i,z as a,A as e,b2 as l}from"./chunks/framework.DkLJC2NO.js";const g=JSON.parse('{"title":"Table组件 methods","description":"","frontmatter":{},"headers":[],"relativePath":"api/table/methods.md","filePath":"api/table/methods.md"}'),t={name:"api/table/methods.md"};function n(o,s,h,p,r,k){return e(),a("div",null,[...s[0]||(s[0]=[l(`<h1 id="table组件-methods" tabindex="-1">Table组件 methods <a class="header-anchor" href="#table组件-methods" aria-label="Permalink to &quot;Table组件 methods&quot;"></a></h1><h2 id="togglerowselection" tabindex="-1">toggleRowSelection <a class="header-anchor" href="#togglerowselection" aria-label="Permalink to &quot;toggleRowSelection&quot;"></a></h2><ul><li><p><strong>参数:</strong></p><ul><li><code>row: any</code> - 要切换选中状态的行数据</li><li><code>selected?: boolean</code> - 是否选中,不传则切换当前状态</li></ul></li><li><p><strong>说明:</strong> 切换某一行的选中状态</p></li><li><p><strong>示例:</strong></p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">tableRef.value.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">toggleRowSelection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(row, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 选中</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">tableRef.value.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">toggleRowSelection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(row, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 取消选中</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">tableRef.value.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">toggleRowSelection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(row); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 切换状态</span></span></code></pre></div></li></ul><h2 id="togglerowexpansion" tabindex="-1">toggleRowExpansion <a class="header-anchor" href="#togglerowexpansion" aria-label="Permalink to &quot;toggleRowExpansion&quot;"></a></h2><ul><li><p><strong>参数:</strong></p><ul><li><code>row: any</code> - 要展开/收起的行数据</li><li><code>expanded?: boolean</code> - 是否展开,不传则切换当前状态</li></ul></li><li><p><strong>说明:</strong> 切换某一行的展开状态(用于可展开表格)</p></li><li><p><strong>示例:</strong></p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">tableRef.value.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">toggleRowExpansion</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(row, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 展开</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">tableRef.value.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">toggleRowExpansion</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">(row, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;">false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">); </span><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;">// 收起</span></span></code></pre></div></li></ul><h2 id="clearselection" tabindex="-1">clearSelection <a class="header-anchor" href="#clearselection" aria-label="Permalink to &quot;clearSelection&quot;"></a></h2><ul><li><p><strong>参数:</strong> 无</p></li><li><p><strong>说明:</strong> 清空所有选中的行</p></li><li><p><strong>示例:</strong></p><div class="language-js vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">js</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">tableRef.value.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">clearSelection</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">();</span></span></code></pre></div></li></ul>`,7)])])}const c=i(t,[["render",n]]);export{g as __pageData,c as default};