Cardview in Nativescript-Vue


#1

How do I make a card in Vue-Nativescript?


#2

Did you go through the docs?


#3

Yeah i did and even the sample there for Gradient doesn’t work either


#4

There is an article on how to use plugins using the Vue-CLI. There are some differences to account for when comparing to other ways of building NativeScript apps.


#5

i assume klever34 , just like me, come from ionic background, which is very easy to create card component.

while in nativescript we had to manually create it with gridlayout


#6

Yeah man, but how can I accomplish that with GridLayout? Does it have elevation, shadow and the others?


#7

It’s not working, I had installed nativescript-vue 1.3.1 and nativescript-cardview 2.0.5
A tuto about it it’s gonna be great


#8

I did try but it is not working
I use nativescript-vue 1.3.1 and nativescript-cardview 2.0.5

If you managed to do it, we would like to see your code about it and publish an article because I integrate well and do what it takes for that but I bug like result


#9

what error are you getting @Fabiyo


#10

I add CardView
tns-cv0
I use it in my project
tns-cv1
and the bug

I love NativeScript-Vue but there is not enough plugin around it !


#11

I think an example on play.nativescript is gonna be great


#12

In phone is writting

An uncaught Exception occured on “main” thread com.tns.nativescriptException: calling js method onCreateView failled
TypeError.andr"oid.support.v7.widget.CardView is not a constructor
File:…/tns_modules/nativescript-cardview/cardview.js line 24, column 15


#13

Have you registered it in your main.js file? and you are using and not Card:CardView tag?


#14

in my file main,js

Vue.registerElement(
“CardView”,
() => require(“nativescript-cardview”).CardView
);


#15

How should I include it in my main.js file and use it in my template ?


#16

main.js :
Vue.registerElement(‘CardView’, () => require(‘nativescript-cardview’).CardView);

in template:



#17

And you need to update nativescript-vue-externals/index.js.
After the request path join line =>
with this: request = request.replace(’\’,’/’);


#18

@Fabiyo Did you do a clean build after installing the plugin, from the error logs it looks like the android support library was not installed properly. Usually a clean build (deleting the platform folders and running the tns commands again) fixes the issue.


#19

I don’t use nativescript-vue-externals in my project, I’m using simples files js. I did create my project with the command cli “tns create nsvue --template nativescript-vue-template” !
How can I use it ?


#20

okay, then do a clean build