Country flag component for Vue. Supports SSR apps.
- vue.js >= 3.0
Add the package to your app via npm:
npm install @dzangolab/vue-country-flag-icon --save
or yarn:
yarn add @dzangolab/vue-country-flag-icon
# main.js
import CountryFlag from '@dzangolab/vue-country-flag-icon'
import '@dzangolab/vue-country-flag-icon/dist/CountryFlag.css' // import stylesheet
app.use('CountryFlag', CountryFlag)
# MyComponent.vue
<template>
<CountryFlag iso="GB" mode="squared" />
<CountryFlag iso="GB" mode="rounded" />
</template>
<script>
import CountryFlag from '@dzangolab/vue-country-flag-icon'
import '@dzangolab/vue-country-flag-icon/dist/CountryFlag.css' // import stylesheet
export default {
components: {
CountryFlag
}
}
</script>
country ISO code (alpha-2 code).
This setting is required.
title for the country flag.
Determines the behavior of the country flag. This component support 2 modes rounded
and squared
.
This setting is required.
Instead of importing the css file in component or main.js, you can also import scss file into your app scss file.
@import '~@dzangolab/vue-country-flag-icon/src/assets/scss/country-flag.scss';