【问题标题】:Use RadListView with nativescript-vue将 RadListView 与 nativescript-vue 一起使用
【发布时间】:2021-08-04 20:18:45
【问题描述】:

我想知道如何将 RadListView 与 nativescript-vue 一起使用。

目前我加载 RadListView :

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

在组件中使用:

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

但是我有这个错误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)

我的 pakages.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",
},

【问题讨论】:

    标签: nativescript nativescript-vue


    【解决方案1】:

    您需要安装 RadListView NPM 包。

    tns plugin add nativescript-ui-listview
    

    【讨论】:

      【解决方案2】:

      我推荐使用这个插件:https://github.com/nativescript-community/ui-collectionview。 它性能更好,并且不断更新

      【讨论】:

        猜你喜欢
        • 2021-04-02
        • 2019-08-13
        • 1970-01-01
        • 2019-05-23
        • 1970-01-01
        • 2019-07-06
        • 1970-01-01
        • 2020-02-24
        • 2021-02-21
        相关资源
        最近更新 更多