【发布时间】:2019-10-20 03:14:06
【问题描述】:
我正在尝试覆盖类星体表中的标准标题。主要是因为我需要一个堆叠的标题(2 行与 colspans/rowspans)。我可以让它看起来正确,但我不能让它表现得像一个正确的表头 - 主要是它不会排序的事实。我已经尝试了几种方法来声明性地绑定它。
<q-table
:data="data"
:columns="columns"
row-key="name" class="col-12">
<template v-slot:header="props">
<q-tr :props="props">
<q-th rowspan="2" >Sku</q-th>
<q-th rowspan="2">Name</q-th>
<q-th colspan="3" style="text-align:center">Sales</q-th>
<q-th rowspan="2" style="text-align:center">Order</q-th>
<q-th colspan="3" style="text-align:center">Before Order</q-th>
<q-th colspan="3" style="text-align:center">After Order</q-th>
<q-th colspan="3" style="text-align:center">Order</q-th>
</q-tr>
<q-tr :props="props">
<q-th>Qty</q-th>
<q-th>Count</q-th>
<q-th>Daily</q-th>
<q-th>Stock</q-th>
<q-th>Days</q-th>
<q-th>Date</q-th>
<q-th>Stock</q-th>
<q-th>Days</q-th>
<q-th>Date</q-th>
<q-th>Price</q-th>
<q-th>Discount</q-th>
<q-th>Total</q-th>
</q-tr>
</template>
</q-table>
【问题讨论】:
-
你能分享一下你在“数据”中存储的对象数组吗,这真的有助于解决这个问题
-
另外请分享样表,想怎么显示..
-
@chans 这里是一个密码箱codesandbox.io/s/codesandbox-app-2im4s
-
你的代码在哪个组件中
-
拿到组件代码后,分享沙箱更新代码