[Vuejs]-Use installed plugin in Nativescript Vue

0👍

Install a plugin with ‘use’. Read here

0👍

You’ll need to modify your component as you would any other Vue project.

Add these lines (for your example):

Example.vue

<template>
<div class="currency-flag currency-flag-usd"></div>
</template>

In your main.js file:

import 'currency-flags'

The issue here is the plugin you’ve selected is mostly CSS based. It may or may not work well with Nativescript.

You could also just copy in the files directly to your project and access them that way. For example, copying src/flags/aed.png to whatever images folder in your project and then accessing it directly.

Leave a comment