vue-virtual-scroller icon indicating copy to clipboard operation
vue-virtual-scroller copied to clipboard

version1.1.2 do not use table tag ?

Open Create-Peace opened this issue 2 years ago • 4 comments
trafficstars

Describe the bug

I'm trying to implement virtual-table by using [email protected] 。But I found vue-virtual-scroller doesnot surport table tag。

 <table>
      <colgroup>
        <col width="400">
        <col width="400">
        <col width="400">
      </colgroup>
      <RecycleScroller
        tag="table"
        :items="items"
        :item-size="42"
        list-tag="tbody"
        item-tag="tr"
        key-field="_id"
        page-mode
      >
        <template slot-scope="props">
          <td>{{ props.item.picture }}</td>
          <td>{{ props.item.name }}</td>
          <td>{{ props.item.company }}</td>
        </template>
      </RecycleScroller>
    </table>

After web page rendered,I found dom structure is not right.

<table>
	<colgroup>
		<col width="400">
		<col width="400">
		<col width="400">
	</colgroup>
	<div class="vue-recycle-scroller ready page-mode direction-vertical" tag="table">
		<!---->
		<tbody class="vue-recycle-scroller__item-wrapper" style="min-height: 208992px;">
			<tr class="vue-recycle-scroller__item-view" style="transform: translateY(0px) translateX(0px);">
				<td>http://placehold.it/32x32</td>
				<td>Compton Albert</td>
				<td>ZAPPIX</td>
			</tr>
			<tr class="vue-recycle-scroller__item-view" style="transform: translateY(42px) translateX(0px);">
				<td>http://placehold.it/32x32</td>
				<td>Daugherty Irwin</td>
				<td>VELITY</td>
			</tr>
			<tr class="vue-recycle-scroller__item-view" style="transform: translateY(84px) translateX(0px);">
				<td>http://placehold.it/32x32</td>
				<td>Hopkins Ramos</td>
				<td>EXOSPACE</td>
			</tr>
			<tr class="vue-recycle-scroller__item-view" style="transform: translateY(126px) translateX(0px);">
				<td>http://placehold.it/32x32</td>
				<td>Stanton Wilcox</td>
				<td>SURELOGIC</td>
			</tr>
			<tr class="vue-recycle-scroller__item-view" style="transform: translateY(168px) translateX(0px);">
				<td>http://placehold.it/32x32</td>
				<td>Savannah Guzman</td>
				<td>HARMONEY</td>
			</tr>
		</tbody>
		<!---->
		<div data-v-b329ee4c="" tabindex="-1" class="resize-observer">
			<object aria-hidden="true" tabindex="-1" type="text/html" data="about:blank"></object>
		</div>
	</div>
</table>

So What am I to do?

Reproduction

https://github.com/Akryum/vue-virtual-scroller/issues/new?assignees=&labels=to+triage&template=bug-report.yml

System Info

npm install

Used Package Manager

npm

Validations

Create-Peace avatar Jan 07 '23 08:01 Create-Peace

I have the same problem in version: 1.1.2

awesomeYG avatar Mar 14 '23 13:03 awesomeYG

Me too. How are we supposed to generate a normal table with header and body?

johandanforth avatar Apr 03 '23 13:04 johandanforth

Me too.

Eviwang avatar Apr 12 '23 09:04 Eviwang

RecycleScroller doesn't have a "tag" prop. You can only have "listTag" and "itemTag". The problem is that RecycleScroller create a div tag wrapping the listTag and the itemTag. It would be nice to do without this div tag and only use "listTag" and "itemTag" props

abdouthetif avatar Aug 31 '23 14:08 abdouthetif