如何解决将 RadListView 与 nativescript-vue 结合使用
我想知道如何将 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>
但我有这个错误未捕获的ReferenceError:TKListViewDelegate未定义:
(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",},
解决方法
您需要安装 RadListView NPM 包。
tns plugin add nativescript-ui-listview
,
我推荐使用这个插件:https://github.com/nativescript-community/ui-collectionview。 它表现更好,并不断更新
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。