main.ts
1 2 3 4 5 6 7 8 9 10 11 |
import { createApp } from 'vue'; import App from './App.vue'; import CountryFlag from 'vue-country-flag-next' const app = createApp(App) // Registering the component globally app.component('CountryFlag', CountryFlag) // Mount the Vue app app.mount('#app'); |
App.vue
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
<template> <div> <h2>Vue Country Flag Example</h2> <!-- Display flags with different sizes --> <CountryFlag country="us" size="big" /> <CountryFlag country="fr" size="normal" /> <CountryFlag country="de" size="small" /> <!-- You can also use custom properties like rounded, shadow, and background --> <CountryFlag country="in" size="big" :rounded="true" :shadow="true" /> </div> </template> <script> export default { name: 'App' } </script> <style scoped> /* Add some custom styling if needed */ div { text-align: center; margin-top: 50px; } </style> |