1 Star 6 Fork 2

fanger / element-china-category-data

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Element UI 国民经济行业分类

npm npm

在日常开发过程中,有区域级联下拉选择的需求,发现了 element-china-area-data 项目。之后又有《国民经济行业分类》数据选择的需求, 所以参考element-china-area-data实现了基于element-ui的国民经济行业分类级联选择器组件。

安装

npm install element-china-category-data -S

在线示例

地址在此,网页打开会比较慢

使用

import { categoryData,  CodeToText, TextToCode } from 'element-china-category-data'
  1. categoryData是国民经济行业分类数据集
  2. CodeToText是个大对象,属性是分类码,属性值是汉字 用法例如:CodeToText['0111']输出稻谷种植
  3. TextToCode是个大对象,属性是汉字,属性值是区域码 用法例如:TextToCode['稻谷种植'].code输出0111
  4. CodeToTextTextToCode的用法可参考 element-china-area-data 文档,使用方法是一致的
  • 省市区三级联动(不带“全部”选项)

    <template>
      <div id="app">
        <el-cascader
          size="large"
          :options="options"
          v-model="selectedOptions"
          @change="handleChange">
        </el-cascader>
      </div>
    </template>
    
    <script>
      import { categoryData } from 'element-china-category-data'
      export default {
        data () {
          return {
            options: categoryData,
            selectedOptions: []
          }
        },
    
        methods: {
          handleChange (value) {
            console.log(value)
          }
        }
      }
    </script>

数据来源

国家统计局《国民经济行业分类》2019修正版

开发过程

npm run dev 是开发

npm run build + npm run build-commonjs + npm run docs 是准备发布

MIT License Copyright (c) 2019 faer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于 Element UI 实现的中国国民经济行业分类级联下拉选择组件 展开 收起
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/xiaofanger/element-china-category-data.git
git@gitee.com:xiaofanger/element-china-category-data.git
xiaofanger
element-china-category-data
element-china-category-data
master

搜索帮助