npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fy-mutiple-region-relect

v3.0.0

Published

基于antd的地区多选组件

Downloads

11

Readme

基于antd的地区多选组件

  • 可以切换为按照大区选择按照拼音选择两种模式
  • 地区可多选,点击大区则相当于选中大区下所有省
  • 支持拼音搜索过滤功能

安装

cnpm install 'fy-mutiple-region-relect'

fy-mutiple-region-relect

npm version npm downloads

fy-mutiple-region-relect 是一个基于 React, Antd 封装的地区选择业务组件;帮助你轻松的解决项目中需要地区多选,选择大区的问题。

最近更新

fy-mutiple-region-relect 升级到3.0 添加拼音搜索过滤功能 支持中文 英文全拼 英文首字母缩写

fy-mutiple-region-relect 升级到2.0 修复bug

fy-mutiple-region-relect 升级到 1.0.8 去掉showDistrict showCity属性 不展示市或区 用disabledDistrict disabledCity

fy-mutiple-region-relect 升级到 1.0.7 增加changeOnSelect

fy-mutiple-region-relect 升级到 1.0.6 更改showClear效果

fy-mutiple-region-relect 升级到 1.0.5,优化样式

fy-mutiple-region-relect 升级到 1.0.3,优化内部代码.

fy-mutiple-region-relect 升级到 1.0.2 支持传入showCity 来是否显示市

fy-mutiple-region-relect 升级到 1.0.1,支持传入showDistrict来是否显示地区.

在线实时演示

http://www.acglouvre.art/#/select


如何在项目中接入 fy-mutiple-region-relect;

安装

npm install --save fy-mutiple-region-relect

组件用法

<div id="app"></div>
.container {
  width: 200px;
  margin: 100px 60px;
  .button-group {
    margin-top: 20px; 
  }
}

import React, { Component } from 'react'
import MultipleRegionSelect from  'fy-mutiple-region-relect'
import { Button } from 'antd'
import regionData from './region'
import './style.scss'

class Select extends Component {
  onMutipleSelect = (ref) => {
    this.mutipleSelect = ref;
  }

  getAddress = ()=>{
    console.log(this.mutipleSelect.getAllAddressArr());
  }

  clearAddress = ()=>{
    this.mutipleSelect.clearAddressArr();
  }

  render(){
    const { regions, allAreaList } = regionData;
    return(
      <div className="container">
        <h2>测试地区多选</h2>
        <MultipleRegionSelect 
          regions={regions}
          allAreaList={allAreaList}
          showClear={true}
          disabledDistrict={true}
          onRef={this.onMutipleSelect}
        />
        <div className="button-group">
          <Button type="primary" onClick={this.getAddress}>获取地区json</Button>
          <Button style={{marginLeft:20}} onClick={this.clearAddress}>重置</Button>
        </div>
      </div>
      
    )
  }
}

export default Select

ReactDOM.render(
  <Select />,
)

示例图片

avatar avatar avatar

参数说明:

参数 | 说明 | 类型 | 默认值 ----|------|-----|------ regions | 省市区JSON | Array | [] allAreaList | 大区JSON | Array | [] showArea | 是否可以切换大区 | Bool | true disabledDistrict | 是否可以选择地区 | Bool | false changeOnSelect | 是否可以支持changeOnSelect | Bool | true