vue-zone
v0.0.3
Published
Vue-based area selection component
Downloads
14
Maintainers
Readme
vue-zone
Vue-based zone selection component
Screenshots
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 Name | Description | Return Value | | ----- | ----- | ----- | | change | Callback 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