Floating action button


#1

I use the plugin nativescript-floatingactionbutton doesn’t work


#2

Please try to ask good and detailed question. No body may able to help with the this info, always try to give as much details as possible. What you tried, where it failed, what error it gives etc.,


#3

I installed “nativescript-floatingactionbutton” with the cmd line “npm install --save nativescript-floatingactionbutton” and after this in my main.js file I did integrate it by this code “Vue.registerElement(“Fab”,()=> requis…).Fab”
And when I use it in my template I have a bug about onCreate


#4

What is the bug exactly, can you post the error log?


#5

This is the bug on my device


#6

Looks like the same dependency issue, check you have required android support libraries in place and then try a clean build.


#7

I don’t understand everything you are explaining


#8

I have decided to create my own component vue, my own floating action button


#9

Just in case somebody comes across this. The plugin first mentioned by the OP worked for me just fine.

As mentioned in the post at https://www.nativescript.org/blog/using-plugins-in-a-nativescript-vue-app, you’ll have to run the clean command after adding the plugin. I had success by:

> npm run i nativescript-floatingactionbutton
...
> npm run clean
...
> npm run debug:android

Added the following line to main.js

Vue.registerElement('Fab', ()=> require('nativescript-floatingactionbutton').Fab)

Then, I added the following markup to Main.vue

 <Fab  icon="res://markerpen" class="fab-button" ></Fab>

The button did require some sizing with the .fab-button CSS.