Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

region-select

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

region-select

地区级联选择框

  • 0.3.4
  • npm
  • Socket score

Version published
Weekly downloads
21
decreased by-85.91%
Maintainers
1
Weekly downloads
 
Created
Source

region-select

引入

yarn add region-select
npm i region-select

依赖项:
element-ui

使用

RegionSelect 0.3.0 版本升级
取消外部数据源,由于组件维护全国地区树JSON
如需部分地区地区树,可用filter筛选
地区级联选择组件,根据所选最后一级id数据级联选中

<RegionSelect 
    v-model="areaCode"          选中地区 code
    :label.sync='areaLabel'     选中地区 label
    :size='size'                尺寸                             默认medium  (非必输)
    :disabled='false'           是否禁用                          默认false  (非必输)
    :placeholder='xxx'          占位文本                          默认“所属地区”  (非必输)
    :props='props'              对象属性绑定                      默认如props对象  (非必输)
    :clearable='false'          是否可清空
    filter='0001'               地区过滤,是否只需要部分地区
    :filterShowChild='false'     只显示过滤地区的子类地区(需 filter 过滤才会生效)
    :level='1'                  地区树显示层级(如有地区过滤,则为过滤后地区树的层级)                    
    @change='changeFun'         change事件,当选中节点变化时触发
/>
props 默认对象
props = {
        checkStrictly: false,    // 任意层级可选,默认false      可通过 props.checkStrictly = true 来设置父子节点取消选中关联,从而达到选择任意一级选项的。
        multiple: false          // 是否多选,默认false          多选情况下,返回数据为字符数组
}
全局默认设置
如需在项目中对 RegionSelect 进行一些公共配置,可在 main.js 注册组件时,注入 config 属性对象
* 在页面中对 config 中属性进入重复设置,会覆盖全局设置

import RegionSelect from 'region-select'
Vue.use(RegionSelect,{
    filter:'520000000000',     地区过滤,是否只需要其子类地区
    level = '2'                地区树显示层级(如有地区过滤,则为过滤后地区树的层级)   
    placeholder = '所属地区'    占位文本
    props = option.props       属性绑定
})

FAQs

Package last updated on 27 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc