Skip to content

cjustinobi/vue-nigeria-states-lgas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# vue-nigeria-states-lgas

NPM

npm version

Vue library that lists Nigeria states and LGAs

Installation

npm install vue-nigeria-states-lgas

Usage

In the component where you want use Nigeria states and Lgas

import StatesLgas from 'vue-nigeria-states-lgas/dist/vue-naija-states-lgas.esm.js'

Then register the component locally:

<script>
   import StatesLgas from 'vue-nigeria-states-lgas/dist/vue-naija-states-lgas.esm.js'
   

   exports default {
      ...
      
      components: { StatesLgas }
      
      ... 
   }
</script>

Listen directly to events (selected state and lga) emitted from StatesLgas component using v-on:state="getState" to get the state and v-on:lga="getLga"

On the getState and getLga methods, you now have the seleted state and lga.

<script>
   import StatesLgas from 'vue-nigeria-states-lgas/dist/vue-naija-states-lgas.esm.js'
   
   exports default {
      ...
      
      components: { StatesLgas },
      
      methods: {
          getState(state) {
              alert(state)
          },
          
          getLga(lga) {
               alert(lga)
           }
      }
      
      ... 
   }
</script>

About

Vue library that lists Nigeria states and LGAs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published