@beisen-cmps/area-selector

平台地区组件

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@beisen-cmps/area-selector
Minified + gzip package size for @beisen-cmps/area-selector in KB

Readme

area-selector 使用说明

项目运行

  1. cnpm install 或 npm install cnpm使用教程

  2. npm run dev (开发环境打包 port:8080)

  3. npm run test (测试用例)

  4. npm run build (生产环境打包)

base-button参数


    {
      data: AreaData,
      isSingleSelect: false,  //单多选
      totalCount: 99,         // 可选总数
      allLevelDisplay:true,   //是否显示所有级别,默认true
      hiddenTip:false,        //ToolTip的hidden字段,默认false
      sideTip:false,          //ToolTip的side字段,默认false
      defaultResults: [       // 默认选中
        {
          name: '全国',
          id: 1
        },
        {
          id: 3702,
          name: '青岛市'
        }
      ],
      sureClick: function (data) {
        console.log(data);
      },
      cancelClick: function () {
        console.log(11)
      }
    }

base-button调用方法

1.安装npm组件包

npm install @beisen/area-selector --save-dev

2.引用组件

import AreaSelect from "@beisen/area-selector"
  1. 传入参数

    该参数为上述参数,传入方式使用: {...参数}

    class Demo extends Component{
    
    render () {
      const _data = {
        data: AreaData,
        isSingleSelect: false,
        totalCount: 99,
        defaultResults: [
          {
            name: '全国',
            id: 1
          },
          {
            id: 3702,
            name: '青岛市'
          }
        ],
        sureClick: function (data) {
          console.log(data);
        },
        cancelClick: function () {
          console.log(11)
        }
      }
      return (
        <div>
            <App {..._data}/>
        </div>
      )
    }
    }
    render(<Demo />, document.getElementById('content'))
    

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.