1.0.6 • Published 8 years ago

vue-twzipcode v1.0.6

Weekly downloads
8
License
MIT
Repository
github
Last release
8 years ago

Vue-TWzipcode

Build Status Coverage Status

Rewrite jQuery-TWzipcode in Vue.js

Screenshot

pic

Example

Example

Installation

$ npm install vue-twzipcode --save

Usage

import Vue from 'vue';
import Twzipcode from 'vue-twzipcode';

const app = new Vue({
  el: '#app',
  components: {
    Twzipcode: Twzipcode,
    // or
    Twzipcode,
  },
});
<div id="app">
  <label>Address:</label>
  <twzipcode
    :class-names="{county: 'form-control', district: 'form-control', zipcode: 'form-control'}"
    default-zipcode="403"
    v-ref:twzipcode
  >
  </twzipcode>
</div>

Get Values

const {county, district, zipcode } = app.$refs.twzipcode;

// 台中市, 西區, 403
console.log(county, district, zipcode);

Props

PropTypeDefaultExample
namesObject{county: 'county', district: 'district', zipcode: 'zipcode'}{county: 'my-county', district: 'my-district', zipcode: 'my-zipcode'}
classNamesObject{county: '', district: '', zipcode: ''}{county: 'form-control', district: 'form-control', zipcode: 'form-control'}
defaultCountyString'基隆市'default-county="台中市"
defaultDistrictString''default-district="西區"
defaultZipcodeString''default-zipcode="403"
  1. Using props to component, notice kebab-case
  2. defaultZipcode is highest priority than defaultCounty and defaultDistrict. So if you using both, will be ignored 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.

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago