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

Use with jsx

Open maratfakhreev opened this issue 6 years ago • 2 comments
trafficstars

Hi. Is it possible to use vue-virtual-scroller with jsx? Main question is how to have access to item and its attributes.

My code looks like this one and seems that I can't use v-slot inside jsx.

<RecycleScroller pageMode items={this.sortedLists.rules} itemSize="20" keyField="id">
  <AutomationListRow
    //v-slot="{rule}"
    rule={rule}
    checkedRules={this.checkedRules}
    check={this.checkRule}
    actions={this.ruleActions}
  />
</RecycleScroller>

My default list without vurtual scroller:

{this.sortedLists.rules.map(rule => (
  <AutomationListRow
    key={rule.id}
    rule={rule}
    checkedRules={this.checkedRules}
    check={this.checkRule}
    actions={this.ruleActions}
  />
))}

maratfakhreev avatar Apr 20 '19 08:04 maratfakhreev

Hi. Is it possible to use vue-virtual-scroller with jsx? Main question is how to have access to item and its attributes.

My code looks like this one and seems that I can't use v-slot inside jsx.

<RecycleScroller pageMode items={this.sortedLists.rules} itemSize="20" keyField="id">
  <AutomationListRow
    //v-slot="{rule}"
    rule={rule}
    checkedRules={this.checkedRules}
    check={this.checkRule}
    actions={this.ruleActions}
  />
</RecycleScroller>

My default list without vurtual scroller:

{this.sortedLists.rules.map(rule => (
  <AutomationListRow
    key={rule.id}
    rule={rule}
    checkedRules={this.checkedRules}
    check={this.checkRule}
    actions={this.ruleActions}
  />
))}

How did you solve this issue? I have the same problem.

webistomin avatar May 26 '20 06:05 webistomin

look here <RecycleScroller pageMode items={this.sortedLists.rules} itemSize="20" keyField="id"> {{ default: ({item}) => <AutomationListRow //v-slot="{rule}" rule={rule} checkedRules={this.checkedRules} check={this.checkRule} actions={this.ruleActions} /> }} </RecycleScroller>

liziwork avatar Nov 17 '23 07:11 liziwork