RadListView: неизвестный пользовательский элемент: <ReorderHandle> - PullRequest
0 голосов
/ 11 июля 2019

Я получаю сообщение об ошибке при использовании 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.

Как я могу использовать ReorderHandle в Nativescript-vue в соответствии с этой ссылкой на документ ?

Любая помощь по этой функции будет оценена.

Вот мои коды

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 Ответ

0 голосов
/ 12 июля 2019

Существует пример 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>

Более подробную информацию можно найти здесь .

...