table
模板:
<a-table class="table" :columns="c_columns" :data-source="data"
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
:pagination="false"
:loading="loading">
<template slot="action" slot-scope="row">
...
</template>
{:widget('table_slot')}
</a-table>
模板中 c_columns
是一个计算属性, 通过 Mixins.table
引入。columns
是表格列的配置描述,可参见 https://1x.antdv.com/components/table-cn/#API
以下参数与 antd
有所区别:
参数 | 描述 | 值 |
---|---|---|
visible |
列显示/隐藏 | Boolean Function |
search |
search 组件的配置项, 详见 |
Object Function |
<p>模板:</p>
<pre class="prettyprint linenums prettyprinted" style=""><ol class="linenums"><li class="L0"><code><span class="tag"><a-table</span><span class="pln"> </span><span class="atn">class</span><span class="pun">=</span><span class="atv">"table"</span><span class="pln"> :</span><span class="atn">columns</span><span class="pun">=</span><span class="atv">"c_columns"</span><span class="pln"> :</span><span class="atn">data-source</span><span class="pun">=</span><span class="atv">"data"</span><span class="pln"> </span></code></li><li class="L1"><code><span class="pln"> :</span><span class="atn">row-selection</span><span class="pun">=</span><span class="atv">"{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"</span></code></li><li class="L2"><code><span class="pln"> :</span><span class="atn">pagination</span><span class="pun">=</span><span class="atv">"false"</span></code></li><li class="L3"><code><span class="pln"> :</span><span class="atn">loading</span><span class="pun">=</span><span class="atv">"loading"</span><span class="tag">></span></code></li><li class="L4"><code><span class="pln"> </span><span class="tag"><template</span><span class="pln"> </span><span class="atn">slot</span><span class="pun">=</span><span class="atv">"action"</span><span class="pln"> </span><span class="atn">slot-scope</span><span class="pun">=</span><span class="atv">"row"</span><span class="tag">></span></code></li><li class="L5"><code><span class="pln"> ...</span></code></li><li class="L6"><code><span class="pln"> </span><span class="tag"></template></span></code></li><li class="L7"><code><span class="pln"> {:widget('table_slot')}</span></code></li><li class="L8"><code><span class="tag"></a-table></span></code></li></ol></pre><p>模板中 <code>c_columns</code> 是一个计算属性, 通过 <code>Mixins.table</code> 引入。<br><code>columns</code>是表格列的配置描述,可参见 <a href="https://1x.antdv.com/components/table-cn/#API">https://1x.antdv.com/components/table-cn/#API</a></p>
<p>以下参数与 <code>antd</code> 有所区别:</p>
<table>
<thead>
<tr>
<th>参数</th>
<th>描述</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>visible</code></td>
<td>列显示/隐藏</td>
<td><code>Boolean</code> <code>Function</code></td>
</tr>
<tr>
<td><code>search</code></td>
<td><code>search</code>组件的配置项, <a href="https://www.01soft.top/doc/topic/show/1-14.html" title="详见">详见</a></td>
<td><code>Object</code> <code>Function</code></td>
</tr>
</tbody>
</table>