3.0.1 • Published 5 years ago

gq-plus v3.0.1

Weekly downloads
171
License
MIT
Repository
github
Last release
5 years ago

Install

Using npm:

npm install gq-plus --save

import areaGq from 'gq-plus';
Vue.use(areaGq);

Usage

根据地区码获取地区中文:

this.$GqPlus.getTextByCode(code)

重置地区:

this.reset()

Usage

<template>
    <areaSelect @on-change="onChange" />
    <areaSelect :value="value" />
</template>
<script>
    export default {
        data () {
            return {
                value: ['河南省', '洛阳市', '偃师市']
            }
        },
        methods: {
        	//地区选择事件回调
        	onChange(area){
        		//area 是个对象 code: 地区编码, label: 地区中文,数组
        		console.log(area)
        	},
            //根据code返回省市县数据
            getTextByCode(){
                let text = this.$GqPlus.getTextByCode("110101")
                //text 返回值 北京市-市辖区-东城区
            }
        },
        methods: {
            //重置
            reset(){
                //三种方法都支持
                this.value = ''
                //this.value = []
                //this.value = '000000'
            }
        }
    }
</script>

API AreaSelect

props

属性说明类型默认值
value地区code编码, 6位数字或者地区中文数组String, Number, Array-
disabled设置为禁止选择状态Booleanfalse
labelWidth省/市/县 输入框默认宽度Number145
level要显示的级别,如设为2则显示省、市和县,即3级,级别可设为0、1、2Number2
showSearch是否开启搜索功能,默认开启Booleantrue

events

事件名说明返回值返回值参数说明
on-change选择地区时触发Objece{ code, label }code: 地区编码, label: 地区中文,数组

Copyright (c) 2019-01-16, 32237384@qq.com

3.0.1

5 years ago

3.0.0

5 years ago

2.1.5

5 years ago

2.1.4

5 years ago

2.1.3

5 years ago

2.1.2

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.9

5 years ago

2.0.8

5 years ago

2.0.7

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago