0.0.3 • Published 7 years ago

vue-zone v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

vue-zone

Vue-based zone selection component

Screenshots

vue-zone

Install

Get source from npm or yarn.

# Npm
$ npm install vue-zone --save

# Yarn (recommend)
$ yarn add vue-zone

Support UMD library and individual CSS file.

./lib/
├── vue-zone.js
└── vue-zone.css
./src/
├── /components/
│   ├── area.vue
│   └── area-country.vue
│   └── area-zone.vue
│   └── area-province.vue
└── index.js
// For ES6 module
import Zone from 'vue-zone'

// Import from src code for debugging or self building
import Zone from 'vue-zone/src';

And import CSS file:

require('vue-zone/lib/vue-zone.css');

Usage

<template>
    <div id="app">
        <zone
            @change="handleChange">
        </zone>
    </div>
</template>
export default {
    name: 'app',
    data () {
      return {
        week: []
      }
    },
    methods: {
      handleChange ({ choose }) {
        this.choose = choose
      }
    }
}

API

Events

Event NameDescriptionReturn Value
changeCallback when clicking checkbox.[]

Build Setup

# install dependencies
npm install / yarn install

# serve with hot reload at localhost:8080
npm run demo:dev

# build for demo with minification
npm run demo:build

# build for gh-pages with minification
npm run demo:prepublish

# build for production with minification
npm run build

TODO

  • Remove the dependency on element-ui

License

MIT