RadListView: Unknown custom element: <ReorderHandle>

473 views Asked by At

I am getting an error while using ReorderHandle in reorderMode="Drag" in RadListView component of nativescript-ui-listview/vue like

[Vue warn]: Unknown custom element: <ReorderHandle> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

How can I use ReorderHandle in Nativescript-vue according to this doc link?

Any help on this functionality will be appreciated.

Here are my codes

main.js

import Vue from 'nativescript-vue'
import RadListView from 'nativescript-ui-listview/vue';
Vue.use(RadListView);

My Vue Component

<RadListView ref="listView" for="(manager, index) in managers" :itemReorder="true" reorderMode="Drag">
    <v-template>
        <Label>{{ manager.name }}</Label>
        <ReorderHandle col="1" verticalAlignment="center">
            <Image android:src="res://reorder_icon" ios:src="res://reorder-icon" stretch="none" verticalAlignment="stretch" margin="16" />
        </ReorderHandle>
    </v-template>
</RadListView>
1

There are 1 answers

5
Steven On

There is an Vue example of that.

Like you can see in the code you don't need to add <ReorderHandle>

Example:

<template>
  <RadListView ref="listView"
               for="item in items"
               pullToRefresh="true"
               itemReorder="true"
               swipeActions="true"
               @itemTap="onItemTap"
               @pullToRefreshInitiated="onPullToRefreshInitiated"
               @itemReordered="onItemReordered"
               @itemSwipeProgressStarted="onSwipeStarted">
    <v-template>
      <GridLayout columns="50, *" rows="*" class="item">
        <Image :src="item.image" col="0" class="thumbnail" />
        <StackLayout col="1">
          <label :text="item.name" class="h2" col="1"/>
          <label :text="item.description" class="p" col="1"/>
        </StackLayout>
      </GridLayout>
    </v-template>

    <v-template name="itemswipe">
      <GridLayout columns="auto, *, auto" backgroundColor="White">
        <StackLayout id="mark-view" col="0" class="swipe-item left"
                     orientation="horizontal" @tap="onLeftSwipeClick">
          <Label text="mark" verticalAlignment="center" horizontalAlignment="center"/>
        </StackLayout>
        <StackLayout id="delete-view" col="2" class="swipe-item right"
                     orientation="horizontal" @tap="onRightSwipeClick">
          <Label text="delete" verticalAlignment="center" horizontalAlignment="center" />
        </StackLayout>
      </GridLayout>
    </v-template>
  </RadListView>
</template>

More details can be found here.