RadListView:未知的自定义元素:<ReorderHandle>

时间:2019-07-11 06:00:33

标签: nativescript-vue radlistview nativescript-ui-listview

ReorderHandle的{​​{1}}组件的reorderMode="Drag"中使用RadListView时出现错误,例如

nativescript-ui-listview/vue

如何根据此doc link[Vue warn]: Unknown custom element: <ReorderHandle> - did you register the component correctly? For recursive components, make sure to provide the "name" option.中使用ReorderHandle?

对此功能的任何帮助将不胜感激。

这是我的密码

main.js

Nativescript-vue

我的Vue组件

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

1 个答案:

答案 0 :(得分:0)

其中有Vue example

就像您可以在代码中看到的一样,无需添加<ReorderHandle>

示例:

<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>

更多详细信息,请参见here