简体   繁体   English

将 RadListView 与 nativescript-vue 一起使用

[英]Use RadListView with nativescript-vue

I would liek to know how can I use RadListView with nativescript-vue.我想知道如何将 RadListView 与 nativescript-vue 一起使用。

Currently I load the RadListView:目前我加载 RadListView:

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

Use in component:在组件中使用:

<template>
  <Page>
    <ActionBar>
      <Label text="Home"/>
    </ActionBar>

    <StackLayout orientation="vertical">
      <RadListView ref="listView" for="post in getFeed" height="50%">
        <v-template>
          <Label :text="post.id" />
        </v-template>
      </RadListView>
    </StackLayout>
  </Page>
</template>

But I have this error Uncaught ReferenceError: TKListViewDelegate is not defined :但是我有这个错误Uncaught ReferenceError: TKListViewDelegate is not defined

(CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Uncaught ReferenceError: TKListViewDelegate is not defined
at (file: app/webpack:/@nativescript/template-blank-vue/node_modules/nativescript-ui-listview/ui-listview.ios.js:516:0) at ./node_modules/nativescript-ui-listview/ui-listview.ios.js(file: app/webpack:/@nativescript/template-blank-vue/node_modules/nativescript-ui-listview/ui-listview.ios.js:518:1)

My pakages.json:我的包装。json:

"dependencies": {
    "@nativescript/core": "^8.0.5",
    "@nativescript/theme": "~3.0.1",
    "@triniwiz/nativescript-socketio": "^4.0.1",
    "@triniwiz/nativescript-toasty": "^4.1.3",
    "nativescript-vue": "~2.9.0",
    "nativescript-vue-devtools": "^1.5.1"
},
"devDependencies": {
    "@nativescript/ios": "8.0.0",
    "@nativescript/webpack": "beta",
    "nativescript-ui-listview": "^9.1.0",
    "nativescript-vue-template-compiler": "~2.9.0",
    "tns-core-modules": "^6.5.27",
},

You need to install the RadListView NPM package.您需要安装 RadListView NPM package。

tns plugin add nativescript-ui-listview

I recommend using this plugin: https://github.com/nativescript-community/ui-collectionview .我推荐使用这个插件: https://github.com/nativescript-community/ui-collectionview It performs better and is constantly being updated它性能更好,并且不断更新

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM