Vue-TWzipcode
Rewrite jQuery-TWzipcode in Vue.js
Screenshot
Example
Installation
$ npm install vue-twzipcode --save
Usage
;;const app =el: '#app'components:Twzipcode: Twzipcode// orTwzipcode;
Address:
Get Values
const county district zipcode = app$refstwzipcode;// 台中市, 西區, 403console;
Props
Prop | Type | Default | Example |
---|---|---|---|
names | Object | {county: 'county', district: 'district', zipcode: 'zipcode'} |
{county: 'my-county', district: 'my-district', zipcode: 'my-zipcode'} |
classNames | Object | {county: '', district: '', zipcode: ''} |
{county: 'form-control', district: 'form-control', zipcode: 'form-control'} |
defaultCounty | String | '基隆市' | default-county="台中市" |
defaultDistrict | String | '' | default-district="西區" |
defaultZipcode | String | '' | default-zipcode="403" |
- Using props to component, notice
kebab-case
- defaultZipcode is
highest
priority than defaultCounty and defaultDistrict. So if you using both, will beignored
defaultCounty and defaultDistrict props.
Contributing
All contributions (in the form on pull requests, issues and feature-requests) are welcome.
License
Licenced under the MIT License (MIT). Please see the license file for more information.