0

ReorderHandle在类似reorderMode="Drag"RadListView组件中使用时出现错误nativescript-ui-listview/vue

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

如何Nativescript-vue根据此文档链接使用 ReorderHandle ?

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

这是我的代码

main.js

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

我的 Vue 组件

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

1 回答 1

0

有一个Vue 示例

就像您在不需要添加的代码中看到的那样<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>

更多细节可以在这里找到。

于 2019-07-12T09:50:02.007 回答