All Projects → vikkio88 → vue-flag-icon

vikkio88 / vue-flag-icon

Licence: other
a vue compoment for flag-icon-css

Programming Languages

Vue
7211 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to vue-flag-icon

Xcui
🍴 A Vue.js 2.x desktop components colletion
Stars: ✭ 88 (+37.5%)
Mutual labels:  vue-components, vue2
Vue Objccn
🔥 Use Vue.js to develop a cross-platform full stack application / 用 Vue.js 开发的跨三端应用
Stars: ✭ 1,993 (+3014.06%)
Mutual labels:  vue-components, vue2
V Dialogs
A simple and clean instructional dialog plugin for Vue2, dialog type including Modal, Alert, Mask and Toast
Stars: ✭ 121 (+89.06%)
Mutual labels:  vue-components, vue2
Vue Lazyload Images
A plugin of lazy-load images for Vue2.x
Stars: ✭ 61 (-4.69%)
Mutual labels:  vue-components, vue2
Vuemmerce
👉 Responsive ecommerce template 🛒 built with Vue.js and Nuxt.js
Stars: ✭ 223 (+248.44%)
Mutual labels:  vue-components, vue2
Vue Cnode
基于vue2 + vue-router + vuet + ES6 + less + flex.css重写vue版cnode社区,使用webpack2打包
Stars: ✭ 1,134 (+1671.88%)
Mutual labels:  vue-components, vue2
Vue Codemirror
⌨️ @codemirror component for @vuejs
Stars: ✭ 2,115 (+3204.69%)
Mutual labels:  vue-components, vue2
Vuestic Admin
Free and Beautiful Vue 3 Admin Template
Stars: ✭ 8,398 (+13021.88%)
Mutual labels:  vue-components, vue2
V Bar
The virtual responsive crossbrowser scrollbar component for VueJS 2x
Stars: ✭ 216 (+237.5%)
Mutual labels:  vue-components, vue2
Amaze Vue
一只基于amazeui样式封装的vue组件库。万水千山总是情,点个star再走行不行~~~
Stars: ✭ 211 (+229.69%)
Mutual labels:  vue-components, vue2
v-intl
Add i18n to your awesome Vue 3 app 🔉
Stars: ✭ 13 (-79.69%)
Mutual labels:  vue-components, vue2
vue-drag-zone
Drag Zone component for @vuejs
Stars: ✭ 127 (+98.44%)
Mutual labels:  vue-components, vue2
Vue Aplayer
🍰 Easy-to-use music player for Vue 2.x
Stars: ✭ 1,087 (+1598.44%)
Mutual labels:  vue-components, vue2
Vue Particles
Vue.js component for particles backgrounds ✨
Stars: ✭ 1,220 (+1806.25%)
Mutual labels:  vue-components, vue2
Vuex Flash
VueJs Flash Message Component within Vuex
Stars: ✭ 54 (-15.62%)
Mutual labels:  vue-components, vue2
Vue Awesome Swiper
🏆 Swiper component for @vuejs
Stars: ✭ 12,072 (+18762.5%)
Mutual labels:  vue-components, vue2
Vue Image Loader
Vue progressive image loader plugin like Medium
Stars: ✭ 47 (-26.56%)
Mutual labels:  vue-components, vue2
Pure Vue Chart
Simple and lightweight vue chart component without using chart library dependencies
Stars: ✭ 50 (-21.87%)
Mutual labels:  vue-components, vue2
Heyui
🎉UI Toolkit for Web, Vue2.0 http://www.heyui.top
Stars: ✭ 2,373 (+3607.81%)
Mutual labels:  vue-components, vue2
Vue Form Json Schema
Create forms using JSON schema. Bring your components!
Stars: ✭ 253 (+295.31%)
Mutual labels:  vue-components, vue2

Vue-Flag-Icon

NPM

a Vue2 Compoment for flag-icons

Install

npm i --save vue-flag-icon

Usage

Just declare the global Compoment with the use directive in your app

import FlagIcon from 'vue-flag-icon'
Vue.use(FlagIcon);

Then to use it

<template>
<div>
...

<flag iso="it" />
<flag iso="gb" />
<flag iso="us" />

...
</div>
</template

To see a full set of all the icons and countries iso codes visit the flag-icons website. There are 246 different icons there.

Being svg files they are resizable as long as you set the font size accordingly in a wrapper element

<div style="font-size:180px">
    <flag iso="it" />
</div>

The property iso can be as well dynamically set from an object

let guy = {
    name: "Vincenzo",
    nationality: "it"
}

in the Compoment you should dynamically bind the value

<flag :iso="guy.nationality" />

Screenshot

Code Example

(it is the basic vue-cli webpack template)

<template>
  <div id="app">
    <img src="./assets/logo.png">
    <hello></hello>
    <flag iso="it" />
    <flag iso="gb" />
    <flag iso="us" />
  </div>
</template>

<script>
import Hello from './components/Hello'

export default {
  name: 'app',
  components: {
    Hello
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>

Additional Props

From 1.0.4 you can now specify two different properties:

  • squared : it will render the flag as a square if true, otherwise the flag will be rectangular shaped (true by default).
  • title : you can specify the title of the flag icon, (by default it will be overwritten by the iso)

Result

image

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].