{"id":17967483,"url":"https://github.com/msidolphin/element-ui-area","last_synced_at":"2025-06-23T09:06:28.967Z","repository":{"id":96236639,"uuid":"182549403","full_name":"msidolphin/element-ui-area","owner":"msidolphin","description":"An area component bases on Vue and ElementUI","archived":false,"fork":false,"pushed_at":"2020-07-09T07:52:39.000Z","size":104,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-23T09:06:16.168Z","etag":null,"topics":["china-area","element-ui","vuecomponent"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/msidolphin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-21T15:17:32.000Z","updated_at":"2021-01-15T08:56:28.000Z","dependencies_parsed_at":"2023-04-15T04:14:45.240Z","dependency_job_id":null,"html_url":"https://github.com/msidolphin/element-ui-area","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/msidolphin/element-ui-area","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Felement-ui-area","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Felement-ui-area/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Felement-ui-area/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Felement-ui-area/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/msidolphin","download_url":"https://codeload.github.com/msidolphin/element-ui-area/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/msidolphin%2Felement-ui-area/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261449777,"owners_count":23159804,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["china-area","element-ui","vuecomponent"],"created_at":"2024-10-29T14:08:59.119Z","updated_at":"2025-06-23T09:06:23.924Z","avatar_url":"https://github.com/msidolphin.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# element-ui-area\n\n\u003e 基于Vue和ElementUI的中国行政区划选择器\n\n## 安装\n\n```bash\nnpm install element-ui-area -S\n```\n\n## 使用方式\n\n\u003e 项目依赖于[Element-UI](https://github.com/ElemeFE/element)，您需要先进行引入\n\n### 引入\n```javascript\nimport AreaComponent from 'element-ui-area'\nVue.use(AreaComponent, {})\n\n// or\nimport {Cascader, Select} from 'element-ui-area'\nVue.use(Cascader, {})\nVue.use(Select, {})\n```\n#### 配置项\n| 属性 | 类型 | 说明 | 默认值 |\n| :------ | :------ | :------ | --- |\n| dataSource | Object | 数据源 | - |\n\n### 使用\n\n#### Cascader\n```vue\n\u003ctemplate\u003e\n    \u003carea-cascader v-model=\"value\" :level=\"3\" @change=\"onChange\"/\u003e\n\u003c/template\u003e\n\u003cscript\u003e\nexport default {\n    data () {\n        return {\n            value: []\n        }\n    },\n    methods: {\n        onChange (val, text) {\n            console.log(val)\n            console.log(text) // 地区中文\n        }\n    }\n}\n\u003c/script\u003e\n```\n\n#### Select\n```vue\n\u003ctemplate\u003e\n    \u003cdiv style=\"width:600px;margin:10px auto;\"\u003e\n      \u003carea-select v-model=\"value\" :level=\"1\"/\u003e\n      \u003carea-select v-model=\"value1\" :level=\"2\"/\u003e\n      \u003carea-select v-model=\"value2\" :level=\"3\"/\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\u003cscript\u003e\nexport default {\n    data () {\n        return {\n            value: [],\n            value1: [],\n            value2: []\n        }\n    }\n}\n\u003c/script\u003e\n```\n\n## 配置项\n\n### area-cascader\n\n| 属性 | 类型 | 说明 | 默认值 |\n| :------ | :------ | :------ | --- |\n| value | String | 绑定值 | [ ] |\n| level | Number | 层级，由于数据原因，目前最多只支持三级 | 3 |\n| disabled | Boolean | 是否禁用 | false |\n| size | String | 尺寸 | small |\n| noMatchText | String | 无匹配项时展现的文字 | 无匹配数据 |\n| noDataText | String | 无数据时展现的文字 | 无数据 |\n| clearable | Boolean | 是否支持清空 | true |\n| placeholder | String | 占位符 | 请选择地区 |\n| immediate | Boolean | 是否立即触发change事件 | true |\n| dataSource | Object | 数据源 | 6位短编码行政区划 |\n\n### area-select\n\n| 属性 | 类型 | 说明 | 默认值 |\n| :------ | :------ | :------ | --- |\n| value | String | 绑定值 | [ ] |\n| level | Number | 层级，由于数据原因，目前最多只支持三级 | 3 |\n| disabled | Boolean | 是否禁用 | false |\n| size | String | 尺寸 | small |\n| gutter | number | 间距 | 10 |\n| noMatchText | String | 无匹配项时展现的文字 | 无匹配数据 |\n| noDataText | String | 无数据时展现的文字 | 无数据 |\n| clearable | Boolean | 是否支持清空 | true |\n| placeholder | Array | 占位符 | ['请选择省', '请选择市', '请选择区县', '请选择街道'] |\n|filterable | Boolean | 是否支持搜索 | false |\n| immediate | Boolean | 是否立即触发change事件 | true |\n| dataSource | Object | 数据源 | 6位短编码行政区划 |\n\n## 事件\n\n| 名称 | 说明 | 参数 |\n| :------ | :------ | :------ |\n| change | 选中值改变事件，初始化时会触发一次 | 改变后的值, 中文名称 |\n| blur | 失去焦点 | 事件对象 |\n| focus | 聚焦 | 事件对象|\n\n## 数据源格式范例\n```json\n{\n\t\"86\": {\n\t\t\"110000\": \"北京市\",\n\t},\n\t\"110000\": {\n\t\t\"110100\": \"市辖区\"\n\t},\n\t\"110100\": {\n\t\t\"110101\": \"东城区\",\n\t\t\"110102\": \"西城区\",\n\t\t\"110105\": \"朝阳区\",\n\t\t\"110106\": \"丰台区\",\n\t\t\"110107\": \"石景山区\",\n\t\t\"110108\": \"海淀区\",\n\t\t\"110109\": \"门头沟区\",\n\t\t\"110111\": \"房山区\",\n\t\t\"110112\": \"通州区\",\n\t\t\"110113\": \"顺义区\",\n\t\t\"110114\": \"昌平区\",\n\t\t\"110115\": \"大兴区\",\n\t\t\"110116\": \"怀柔区\",\n\t\t\"110117\": \"平谷区\",\n\t\t\"110118\": \"密云区\",\n\t\t\"110119\": \"延庆区\"\n    }\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsidolphin%2Felement-ui-area","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsidolphin%2Felement-ui-area","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsidolphin%2Felement-ui-area/lists"}