UNPKG

province-city-china

Version:

An util to query china province, city and district data. 中华人民共和国国家标准 GB/T 2260 行政区划代码。

1,018 lines 150 kB
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>province-city-china</title>
    <meta content="width=device-width, initial-scale=1" name="viewport">
    <meta description="An util to query china province, city and district data. 中华人民共和国国家标准 GB/T 2260 行政区划代码。">
    <link rel="icon" href="data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20viewBox=%220%200%20100%20100%22%3E%3Ctext%20y=%22.9em%22%20font-size=%2290%22%3E🇨🇳%3C/text%3E%3C/svg%3E" type="image/x-icon">
  </head>
  <body><script type="module">const GITHUB_CORNERS_TEMPLATE = document.createElement("template");
GITHUB_CORNERS_TEMPLATE.innerHTML = `
<style>
:host a:hover .octo-arm { animation: octocat-wave 560ms ease-in-out; }
@keyframes octocat-wave {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(-25deg); }
  40%, 80% { transform: rotate(10deg); }
}
@media (max-width:500px) {
  :host a:hover .octo-arm { animation: none; }
  :host .octo-arm { animation: octocat-wave 560ms ease-in-out; }
}
:host svg { z-index: 99; position: fixed; border: 0px; top: 0px; }
</style>
<svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true">
  <a xlink:href="https://github.com/uiwjs/react-github-corners" target="_blank" rel="nofollow sponsored" style="fill: rgb(21, 21, 19); color: rgb(255, 255, 255);">
    <g>
      <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
      <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" class="octo-arm" style="transform-origin: 130px 106px;"></path>
      <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path>
    </g>
  </a>
</svg>
`;
export class GithubCorners extends HTMLElement {
    constructor() {
        super();
        this.right = '0';
        this.shadow = this.attachShadow({ mode: 'open' });
        this.shadow.appendChild(this.ownerDocument.importNode(GITHUB_CORNERS_TEMPLATE.content, true));
        this.update();
    }
    static get observedAttributes() {
        return ['style', 'z-index', 'target', 'height', 'width', 'href', 'color', 'fill', 'position', 'top', 'left', 'right', 'bottom', 'transform'];
    }
    setAttr(name, value) {
        const svg = this.shadow.querySelector('svg');
        if (/(href)/.test(name.toLocaleLowerCase())) {
            svg.lastElementChild.setAttribute('xlink:href', value);
        }
        else if (/(color|fill)/.test(name.toLocaleLowerCase())) {
            svg.firstElementChild.style[name] = value;
        }
        else if (/(z-index|position|top|left|right|bottom|transform)/.test(name.toLocaleLowerCase())) {
            svg.style[name] = value;
        }
        else {
            svg.setAttribute(name, value);
        }
    }
    update() {
        ;
        [...this.getAttributeNames(), 'right'].forEach((name) => {
            const value = this.getAttribute(name) || this[name] || '';
            this.setAttr(name, value);
        });
    }
    attributeChangedCallback(name, oldValue, newValue) {
        if (oldValue !== newValue) {
            this.setAttr(name, newValue);
        }
    }
}
customElements.define('github-corners', GithubCorners);</script><github-corners target="__blank" position="fixed" z-index="999" href="https://github.com/uiwjs/province-city-china"></github-corners><dark-mode style="position: fixed; top: 8px; left: 10px; z-index: 999;" dark="Dark" light="Light" permanent="true"></dark-mode><script>const t=document;const e="_dark_mode_theme_";const s="permanent";const o="colorschemechange";const i="permanentcolorscheme";const h="light";const r="dark";const n=(t,e,s=e)=>{Object.defineProperty(t,s,{enumerable:true,get(){const t=this.getAttribute(e);return t===null?"":t},set(t){this.setAttribute(e,t)}})};const c=(t,e,s=e)=>{Object.defineProperty(t,s,{enumerable:true,get(){return this.hasAttribute(e)},set(t){if(t){this.setAttribute(e,"")}else{this.removeAttribute(e)}}})};class a extends HTMLElement{static get observedAttributes(){return["mode",h,r,s]}LOCAL_NANE=e;constructor(){super();this.t()}connectedCallback(){n(this,"mode");n(this,r);n(this,h);c(this,s);const a=localStorage.getItem(e);if(a&&[h,r].includes(a)){this.mode=a;this.permanent=true}if(this.permanent&&!a){localStorage.setItem(e,this.mode)}const l=[h,r].includes(a);if(this.permanent&&a){this.o()}else{if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches){this.mode=r;this.o()}if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches){this.mode=h;this.o()}}if(!this.permanent&&!l){window.matchMedia("(prefers-color-scheme: light)").onchange=t=>{this.mode=t.matches?h:r;this.o()};window.matchMedia("(prefers-color-scheme: dark)").onchange=t=>{this.mode=t.matches?r:h;this.o()}}const d=new MutationObserver(((s,h)=>{this.mode=t.documentElement.dataset.colorMode;if(this.permanent&&l){localStorage.setItem(e,this.mode);this.i(i,{permanent:this.permanent})}this.h();this.i(o,{colorScheme:this.mode})}));d.observe(t.documentElement,{attributes:true});this.i(o,{colorScheme:this.mode});this.h()}attributeChangedCallback(t,s,o){if(t==="mode"&&s!==o&&[h,r].includes(o)){const t=localStorage.getItem(e);if(this.mode===t){this.mode=o;this.h();this.o()}else if(this.mode&&this.mode!==t){this.h();this.o()}}else if((t===h||t===r)&&s!==o){this.h()}if(t==="permanent"&&typeof this.permanent==="boolean"){this.permanent?localStorage.setItem(e,this.mode):localStorage.removeItem(e)}}o(){t.documentElement.setAttribute("data-color-mode",this.mode)}h(){this.icon.textContent=this.mode===h?"🌒":"🌞";this.text.textContent=this.mode===h?this.getAttribute(r):this.getAttribute(h)}t(){var s=this.attachShadow({mode:"open"});this.label=t.createElement("span");this.label.setAttribute("class","wrapper");this.label.onclick=()=>{this.mode=this.mode===h?r:h;if(this.permanent){localStorage.setItem(e,this.mode)}this.o();this.h()};s.appendChild(this.label);this.icon=t.createElement("span");this.label.appendChild(this.icon);this.text=t.createElement("span");this.label.appendChild(this.text);const o=`
[data-color-mode*='dark'], [data-color-mode*='dark'] body {
  color-scheme: dark;
  --color-theme-bg: #0d1117;
  --color-theme-text: #c9d1d9;
  background-color: var(--color-theme-bg);
  color: var(--color-theme-text);
}

[data-color-mode*='light'], [data-color-mode*='light'] body {
  color-scheme: light;
  --color-theme-bg: #fff;
  --color-theme-text: #24292f;
  background-color: var(--color-theme-bg);
  color: var(--color-theme-text);
}`;const i="_dark_mode_style_";const n=t.getElementById(i);if(!n){var c=t.createElement("style");c.id=i;c.textContent=o;t.head.appendChild(c)}var a=t.createElement("style");a.textContent=`
    .wrapper { cursor: pointer; user-select: none; position: relative; }
    .wrapper > span + span { margin-left: .4rem; }
    `;s.appendChild(a)}i(t,e){this.dispatchEvent(new CustomEvent(t,{bubbles:true,composed:true,detail:e}))}}customElements.define("dark-mode",a);</script><script>const __TEMPLATE__ = document.createElement('template');
__TEMPLATE__.innerHTML = `
<style>

markdown-style h1:hover a.anchor .octicon-link:before,
markdown-style h2:hover a.anchor .octicon-link:before,
markdown-style h3:hover a.anchor .octicon-link:before,
markdown-style h4:hover a.anchor .octicon-link:before,
markdown-style h5:hover a.anchor .octicon-link:before,
markdown-style h6:hover a.anchor .octicon-link:before {
  width: 16px;
  height: 16px;
  content: ' ';
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
  mask-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");
}
[data-color-mode*='light'], [data-color-mode*='light'] body, markdown-style[theme*='light'] { --color-prettylights-syntax-comment: #6e7781; --color-prettylights-syntax-constant: #0550ae; --color-prettylights-syntax-entity: #8250df; --color-prettylights-syntax-storage-modifier-import: #24292f; --color-prettylights-syntax-entity-tag: #116329; --color-prettylights-syntax-keyword: #cf222e; --color-prettylights-syntax-string: #0a3069; --color-prettylights-syntax-variable: #953800; --color-prettylights-syntax-brackethighlighter-unmatched: #82071e; --color-prettylights-syntax-invalid-illegal-text: #f6f8fa; --color-prettylights-syntax-invalid-illegal-bg: #82071e; --color-prettylights-syntax-carriage-return-text: #f6f8fa; --color-prettylights-syntax-carriage-return-bg: #cf222e; --color-prettylights-syntax-string-regexp: #116329; --color-prettylights-syntax-markup-list: #3b2300; --color-prettylights-syntax-markup-heading: #0550ae; --color-prettylights-syntax-markup-italic: #24292f; --color-prettylights-syntax-markup-bold: #24292f; --color-prettylights-syntax-markup-deleted-text: #82071e; --color-prettylights-syntax-markup-deleted-bg: #FFEBE9; --color-prettylights-syntax-markup-inserted-text: #116329; --color-prettylights-syntax-markup-inserted-bg: #dafbe1; --color-prettylights-syntax-markup-changed-text: #953800; --color-prettylights-syntax-markup-changed-bg: #ffd8b5; --color-prettylights-syntax-markup-ignored-text: #eaeef2; --color-prettylights-syntax-markup-ignored-bg: #0550ae; --color-prettylights-syntax-meta-diff-range: #8250df; --color-prettylights-syntax-brackethighlighter-angle: #57606a; --color-prettylights-syntax-sublimelinter-gutter-mark: #8c959f; --color-prettylights-syntax-constant-other-reference-link: #0a3069; --color-fg-default: #24292f; --color-fg-muted: #57606a; --color-fg-subtle: #6e7781; --color-canvas-default: #ffffff; --color-canvas-subtle: #f6f8fa; --color-border-default: #d0d7de; --color-border-muted: hsla(210,18%,87%,1); --color-neutral-muted: rgba(175,184,193,0.2); --color-accent-fg: #0969da; --color-accent-emphasis: #0969da; --color-attention-subtle: #fff8c5; --color-danger-fg: #cf222e; } [data-color-mode*='dark'], [data-color-mode*='dark'] body, markdown-style[theme*='dark'] { --color-prettylights-syntax-comment: #8b949e; --color-prettylights-syntax-constant: #79c0ff; --color-prettylights-syntax-entity: #d2a8ff; --color-prettylights-syntax-storage-modifier-import: #c9d1d9; --color-prettylights-syntax-entity-tag: #7ee787; --color-prettylights-syntax-keyword: #ff7b72; --color-prettylights-syntax-string: #a5d6ff; --color-prettylights-syntax-variable: #ffa657; --color-prettylights-syntax-brackethighlighter-unmatched: #f85149; --color-prettylights-syntax-invalid-illegal-text: #f0f6fc; --color-prettylights-syntax-invalid-illegal-bg: #8e1519; --color-prettylights-syntax-carriage-return-text: #f0f6fc; --color-prettylights-syntax-carriage-return-bg: #b62324; --color-prettylights-syntax-string-regexp: #7ee787; --color-prettylights-syntax-markup-list: #f2cc60; --color-prettylights-syntax-markup-heading: #1f6feb; --color-prettylights-syntax-markup-italic: #c9d1d9; --color-prettylights-syntax-markup-bold: #c9d1d9; --color-prettylights-syntax-markup-deleted-text: #ffdcd7; --color-prettylights-syntax-markup-deleted-bg: #67060c; --color-prettylights-syntax-markup-inserted-text: #aff5b4; --color-prettylights-syntax-markup-inserted-bg: #033a16; --color-prettylights-syntax-markup-changed-text: #ffdfb6; --color-prettylights-syntax-markup-changed-bg: #5a1e02; --color-prettylights-syntax-markup-ignored-text: #c9d1d9; --color-prettylights-syntax-markup-ignored-bg: #1158c7; --color-prettylights-syntax-meta-diff-range: #d2a8ff; --color-prettylights-syntax-brackethighlighter-angle: #8b949e; --color-prettylights-syntax-sublimelinter-gutter-mark: #484f58; --color-prettylights-syntax-constant-other-reference-link: #a5d6ff; --color-fg-default: #c9d1d9; --color-fg-muted: #8b949e; --color-fg-subtle: #484f58; --color-canvas-default: #0d1117; --color-canvas-subtle: #161b22; --color-border-default: #30363d; --color-border-muted: #21262d; --color-neutral-muted: rgba(110,118,129,0.4); --color-accent-fg: #58a6ff; --color-accent-emphasis: #1f6feb; --color-attention-subtle: rgba(187,128,9,0.15); --color-danger-fg: #f85149; } markdown-style { display: block; -webkit-text-size-adjust: 100%; font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"; font-size: 16px; line-height: 1.5; word-wrap: break-word; color: var(--color-fg-default); background-color: var(--color-canvas-default); } markdown-style details, markdown-style figcaption, markdown-style figure { display: block; } markdown-style summary { display: list-item; } markdown-style [hidden] { display: none !important; } markdown-style a { background-color: transparent; color: var(--color-accent-fg); text-decoration: none; } markdown-style a:active, markdown-style a:hover { outline-width: 0; } markdown-style abbr[title] { border-bottom: none; text-decoration: underline dotted; } markdown-style b, markdown-style strong { font-weight: 600; } markdown-style dfn { font-style: italic; } markdown-style h1 { margin: .67em 0; font-weight: 600; padding-bottom: .3em; font-size: 2em; border-bottom: 1px solid var(--color-border-muted); } markdown-style mark { background-color: var(--color-attention-subtle); color: var(--color-text-primary); } markdown-style small { font-size: 90%; } markdown-style sub, markdown-style sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } markdown-style sub { bottom: -0.25em; } markdown-style sup { top: -0.5em; } markdown-style img { border-style: none; max-width: 100%; box-sizing: content-box; background-color: var(--color-canvas-default); } markdown-style code, markdown-style kbd, markdown-style pre, markdown-style samp { font-family: monospace,monospace; font-size: 1em; } markdown-style figure { margin: 1em 40px; } markdown-style hr { box-sizing: content-box; overflow: hidden; background: transparent; border-bottom: 1px solid var(--color-border-muted); height: .25em; padding: 0; margin: 24px 0; background-color: var(--color-border-default); border: 0; } markdown-style input { font: inherit; margin: 0; overflow: visible; font-family: inherit; font-size: inherit; line-height: inherit; } markdown-style [type=button], markdown-style [type=reset], markdown-style [type=submit] { -webkit-appearance: button; } markdown-style [type=button]::-moz-focus-inner, markdown-style [type=reset]::-moz-focus-inner, markdown-style [type=submit]::-moz-focus-inner { border-style: none; padding: 0; } markdown-style [type=button]:-moz-focusring, markdown-style [type=reset]:-moz-focusring, markdown-style [type=submit]:-moz-focusring { outline: 1px dotted ButtonText; } markdown-style [type=checkbox], markdown-style [type=radio] { box-sizing: border-box; padding: 0; } markdown-style [type=number]::-webkit-inner-spin-button, markdown-style [type=number]::-webkit-outer-spin-button { height: auto; } markdown-style [type=search] { -webkit-appearance: textfield; outline-offset: -2px; } markdown-style [type=search]::-webkit-search-cancel-button, markdown-style [type=search]::-webkit-search-decoration { -webkit-appearance: none; } markdown-style ::-webkit-input-placeholder { color: inherit; opacity: .54; } markdown-style ::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; } markdown-style a:hover { text-decoration: underline; } markdown-style hr::before { display: table; content: ""; } markdown-style hr::after { display: table; clear: both; content: ""; } markdown-style table { border-spacing: 0; border-collapse: collapse; display: block; width: max-content; max-width: 100%; overflow: auto; } markdown-style td, markdown-style th { padding: 0; } markdown-style details summary { cursor: pointer; } markdown-style details:not([open])>*:not(summary) { display: none !important; } markdown-style kbd { display: inline-block; padding: 3px 5px; font: 11px ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; line-height: 10px; color: var(--color-fg-default); vertical-align: middle; background-color: var(--color-canvas-subtle); border: solid 1px var(--color-neutral-muted); border-bottom-color: var(--color-neutral-muted); border-radius: 6px; box-shadow: inset 0 -1px 0 var(--color-neutral-muted); } markdown-style h1, markdown-style h2, markdown-style h3, markdown-style h4, markdown-style h5, markdown-style h6 { margin-top: 24px; margin-bottom: 16px; font-weight: 600; line-height: 1.25; } markdown-style h2 { font-weight: 600; padding-bottom: .3em; font-size: 1.5em; border-bottom: 1px solid var(--color-border-muted); } markdown-style h3 { font-weight: 600; font-size: 1.25em; } markdown-style h4 { font-weight: 600; font-size: 1em; } markdown-style h5 { font-weight: 600; font-size: .875em; } markdown-style h6 { font-weight: 600; font-size: .85em; color: var(--color-fg-muted); } markdown-style p { margin-top: 0; margin-bottom: 10px; } markdown-style blockquote { margin: 0; padding: 0 1em; color: var(--color-fg-muted); border-left: .25em solid var(--color-border-default); } markdown-style ul, markdown-style ol { margin-top: 0; margin-bottom: 0; padding-left: 2em; } markdown-style ol ol, markdown-style ul ol { list-style-type: lower-roman; } markdown-style ul ul ol, markdown-style ul ol ol, markdown-style ol ul ol, markdown-style ol ol ol { list-style-type: lower-alpha; } markdown-style dd { margin-left: 0; } markdown-style tt, markdown-style code { font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; font-size: 12px; } markdown-style pre { margin-top: 0; margin-bottom: 0; font-family: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; font-size: 12px; word-wrap: normal; } markdown-style .octicon { display: inline-block; overflow: visible !important; vertical-align: text-bottom; fill: currentColor; } markdown-style ::placeholder { color: var(--color-fg-subtle); opacity: 1; } markdown-style input::-webkit-outer-spin-button, markdown-style input::-webkit-inner-spin-button { margin: 0; -webkit-appearance: none; appearance: none; }
markdown-style .token.comment, markdown-style .token.prolog, markdown-style .token.doctype, markdown-style .token.cdata { color: var(--color-prettylights-syntax-comment); } markdown-style .token.namespace { opacity: 0.7; } markdown-style .token.tag, markdown-style .token.selector, markdown-style .token.constant, markdown-style .token.symbol, markdown-style .token.deleted { color: var(--color-prettylights-syntax-entity-tag); } markdown-style .token.maybe-class-name { color: var(--color-prettylights-syntax-variable); } markdown-style .token.property-access, markdown-style .token.operator, markdown-style .token.boolean, markdown-style .token.number, markdown-style .token.selector markdown-style .token.class, markdown-style .token.attr-name, markdown-style .token.string, markdown-style .token.char, markdown-style .token.builtin { color: var(--color-prettylights-syntax-constant); } markdown-style .token.deleted { color: var(--color-prettylights-syntax-markup-deleted-text); } markdown-style .token.property { color: var(--color-prettylights-syntax-constant); } markdown-style .token.punctuation { color: var(--color-prettylights-syntax-markup-bold); } markdown-style .token.function { color: var(--color-prettylights-syntax-entity); } markdown-style .code-line .token.deleted { background-color: var(--color-prettylights-syntax-markup-deleted-bg); } markdown-style .token.inserted { color: var(--color-prettylights-syntax-markup-inserted-text); } markdown-style .code-line .token.inserted { background-color: var(--color-prettylights-syntax-markup-inserted-bg); } markdown-style .token.variable { color: var(--color-prettylights-syntax-constant); } markdown-style .token.entity, markdown-style .token.url, .language-css markdown-style .token.string, .style markdown-style .token.string { color: var(--color-prettylights-syntax-string); } markdown-style .token.color, markdown-style .token.atrule, markdown-style .token.attr-value, markdown-style .token.function, markdown-style .token.class-name { color: var(--color-prettylights-syntax-string); } markdown-style .token.rule, markdown-style .token.regex, markdown-style .token.important, markdown-style .token.keyword { color: var(--color-prettylights-syntax-keyword); } markdown-style .token.coord { color: var(--color-prettylights-syntax-meta-diff-range); } markdown-style .token.important, markdown-style .token.bold { font-weight: bold; } markdown-style .token.italic { font-style: italic; } markdown-style .token.entity { cursor: help; }
markdown-style [data-catalyst] { display: block; } markdown-style g-emoji { font-family: "Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; font-size: 1em; font-style: normal !important; font-weight: 400; line-height: 1; vertical-align: -0.075em; } markdown-style g-emoji img { width: 1em; height: 1em; } markdown-style::before { display: table; content: ""; } markdown-style::after { display: table; clear: both; content: ""; } markdown-style>*:first-child { margin-top: 0 !important; } markdown-style>*:last-child { margin-bottom: 0 !important; } markdown-style a:not([href]) { color: inherit; text-decoration: none; } markdown-style .absent { color: var(--color-danger-fg); } markdown-style a.anchor { float: left; padding-right: 4px; margin-left: -20px; line-height: 1; } markdown-style a.anchor:focus { outline: none; } markdown-style p, markdown-style blockquote, markdown-style ul, markdown-style ol, markdown-style dl, markdown-style table, markdown-style pre, markdown-style details { margin-top: 0; margin-bottom: 16px; } markdown-style blockquote>:first-child { margin-top: 0; } markdown-style blockquote>:last-child { margin-bottom: 0; } markdown-style sup>a::before { content: "["; } markdown-style sup>a::after { content: "]"; }
markdown-style .octicon-video { border: 1px solid #d0d7de !important; border-radius: 6px !important; display: block; } markdown-style .octicon-video summary { border-bottom: 1px solid #d0d7de !important; padding: 8px 16px !important; cursor: pointer; } markdown-style .octicon-video > video { display: block !important; max-width: 100% !important; padding: 2px; box-sizing: border-box; border-bottom-right-radius: 6px !important; border-bottom-left-radius: 6px !important; } markdown-style details.octicon-video:not([open])>*:not(summary) { display: none !important; } markdown-style details.octicon-video:not([open]) > summary { border-bottom: 0 !important; } markdown-style h1 .octicon-link, markdown-style h2 .octicon-link, markdown-style h3 .octicon-link, markdown-style h4 .octicon-link, markdown-style h5 .octicon-link, markdown-style h6 .octicon-link { color: var(--color-fg-default); vertical-align: middle; visibility: hidden; } markdown-style h1:hover .anchor, markdown-style h2:hover .anchor, markdown-style h3:hover .anchor, markdown-style h4:hover .anchor, markdown-style h5:hover .anchor, markdown-style h6:hover .anchor { text-decoration: none; } markdown-style h1:hover .anchor .octicon-link, markdown-style h2:hover .anchor .octicon-link, markdown-style h3:hover .anchor .octicon-link, markdown-style h4:hover .anchor .octicon-link, markdown-style h5:hover .anchor .octicon-link, markdown-style h6:hover .anchor .octicon-link { visibility: visible; } markdown-style h1 tt, markdown-style h1 code, markdown-style h2 tt, markdown-style h2 code, markdown-style h3 tt, markdown-style h3 code, markdown-style h4 tt, markdown-style h4 code, markdown-style h5 tt, markdown-style h5 code, markdown-style h6 tt, markdown-style h6 code { padding: 0 .2em; font-size: inherit; } markdown-style ul.no-list, markdown-style ol.no-list { padding: 0; list-style-type: none; } markdown-style ol[type="1"] { list-style-type: decimal; } markdown-style ol[type=a] { list-style-type: lower-alpha; } markdown-style ol[type=i] { list-style-type: lower-roman; } markdown-style div>ol:not([type]) { list-style-type: decimal; } markdown-style ul ul, markdown-style ul ol, markdown-style ol ol, markdown-style ol ul { margin-top: 0; margin-bottom: 0; } markdown-style li>p { margin-top: 16px; } markdown-style li+li { margin-top: .25em; } markdown-style dl { padding: 0; } markdown-style dl dt { padding: 0; margin-top: 16px; font-size: 1em; font-style: italic; font-weight: 600; } markdown-style dl dd { padding: 0 16px; margin-bottom: 16px; } markdown-style table th { font-weight: 600; } markdown-style table th, markdown-style table td { padding: 6px 13px; border: 1px solid var(--color-border-default); } markdown-style table tr { background-color: var(--color-canvas-default); border-top: 1px solid var(--color-border-muted); } markdown-style table tr:nth-child(2n) { background-color: var(--color-canvas-subtle); } markdown-style table img { background-color: transparent; vertical-align: middle; } markdown-style img[align=right] { padding-left: 20px; } markdown-style img[align=left] { padding-right: 20px; } markdown-style .emoji { max-width: none; vertical-align: text-top; background-color: transparent; } markdown-style span.frame { display: block; overflow: hidden; } markdown-style span.frame>span { display: block; float: left; width: auto; padding: 7px; margin: 13px 0 0; overflow: hidden; border: 1px solid var(--color-border-default); } markdown-style span.frame span img { display: block; float: left; } markdown-style span.frame span span { display: block; padding: 5px 0 0; clear: both; color: var(--color-fg-default); } markdown-style span.align-center { display: block; overflow: hidden; clear: both; } markdown-style span.align-center>span { display: block; margin: 13px auto 0; overflow: hidden; text-align: center; } markdown-style span.align-center span img { margin: 0 auto; text-align: center; } markdown-style span.align-right { display: block; overflow: hidden; clear: both; } markdown-style span.align-right>span { display: block; margin: 13px 0 0; overflow: hidden; text-align: right; } markdown-style span.align-right span img { margin: 0; text-align: right; } markdown-style span.float-left { display: block; float: left; margin-right: 13px; overflow: hidden; } markdown-style span.float-left span { margin: 13px 0 0; } markdown-style span.float-right { display: block; float: right; margin-left: 13px; overflow: hidden; } markdown-style span.float-right>span { display: block; margin: 13px auto 0; overflow: hidden; text-align: right; } markdown-style code, markdown-style tt { padding: .2em .4em; margin: 0; font-size: 85%; background-color: var(--color-neutral-muted); border-radius: 6px; } markdown-style code br, markdown-style tt br { display: none; } markdown-style del code { text-decoration: inherit; } markdown-style pre code { font-size: 100%; } markdown-style pre>code { padding: 0; margin: 0; word-break: normal; white-space: pre; background: transparent; border: 0; } markdown-style pre { position: relative; font-size: 85%; line-height: 1.45; background-color: var(--color-canvas-subtle); border-radius: 6px; } markdown-style pre code, markdown-style pre tt { display: inline; max-width: auto; padding: 0; margin: 0; overflow: visible; line-height: inherit; word-wrap: normal; background-color: transparent; border: 0; } markdown-style pre > code { padding: 16px; overflow: auto; display: block; } markdown-style .csv-data td, markdown-style .csv-data th { padding: 5px; overflow: hidden; font-size: 12px; line-height: 1; text-align: left; white-space: nowrap; } markdown-style .csv-data .blob-num { padding: 10px 8px 9px; text-align: right; background: var(--color-canvas-default); border: 0; } markdown-style .csv-data tr { border-top: 0; } markdown-style .csv-data th { font-weight: 600; background: var(--color-canvas-subtle); border-top: 0; } markdown-style .footnotes { font-size: 12px; color: var(--color-fg-muted); border-top: 1px solid var(--color-border-default); } markdown-style .footnotes ol { padding-left: 16px; } markdown-style .footnotes li { position: relative; } markdown-style .footnotes li:target::before { position: absolute; top: -8px; right: -8px; bottom: -8px; left: -24px; pointer-events: none; content: ""; border: 2px solid var(--color-accent-emphasis); border-radius: 6px; } markdown-style .footnotes li:target { color: var(--color-fg-default); } markdown-style .footnotes .data-footnote-backref g-emoji { font-family: monospace; } markdown-style .task-list-item { list-style-type: none; } markdown-style .task-list-item label { font-weight: 400; } markdown-style .task-list-item.enabled label { cursor: pointer; } markdown-style .task-list-item+.task-list-item { margin-top: 3px; } markdown-style .task-list-item .handle { display: none; } markdown-style .task-list-item-checkbox, markdown-style input[type="checkbox"] { margin: 0 .2em .25em -1.6em; vertical-align: middle; } markdown-style .contains-task-list:dir(rtl) .task-list-item-checkbox, markdown-style .contains-task-list:dir(rtl) input[type="checkbox"] { margin: 0 -1.6em .25em .2em; } markdown-style ::-webkit-calendar-picker-indicator { filter: invert(50%); }
</style>
<slot></slot>
`;
class MarkdownStyle extends HTMLElement {
    constructor() {
        super();
        this.shadow = this.attachShadow({ mode: 'open' });
        this.shadow.appendChild(__TEMPLATE__.content.cloneNode(true));
        const style = Array.prototype.slice
            .call(this.shadow.children)
            .find((item) => item.tagName === 'STYLE');
        if (style) {
            const id = '__MARKDOWN_STYLE__';
            const findStyle = document.getElementById(id);
            if (!findStyle) {
                style.id = id;
                document.head.append(style);
            }
        }
    }
    get theme() {
        const value = this.getAttribute('theme');
        return value === null ? '' : value;
    }
    set theme(name) {
        this.setAttribute('theme', name);
    }
    connectedCallback() {
        if (!this.theme) {
            const { colorMode } = document.documentElement.dataset;
            this.theme = colorMode;
            const observer = new MutationObserver((mutationsList, observer) => {
                this.theme = document.documentElement.dataset.colorMode;
            });
            observer.observe(document.documentElement, { attributes: true });
            window.matchMedia('(prefers-color-scheme: light)').onchange = (event) => {
                this.theme = event.matches ? 'light' : 'dark';
            };
            window.matchMedia('(prefers-color-scheme: dark)').onchange = (event) => {
                this.theme = event.matches ? 'dark' : 'light';
            };
        }
    }
}
customElements.define('markdown-style', MarkdownStyle);</script><markdown-style style="max-width: 960px; margin: 0 auto 60px auto; padding: 8px;" class="markdown-style">
    <h1 id="中华人民共和国行政区划代码"><a class="anchor" aria-hidden="true" tabindex="-1" href="#中华人民共和国行政区划代码"><span class="octicon octicon-link"></span></a>中华人民共和国行政区划代码</h1>
    <p><a href="https://github.com/uiwjs/province-city-china/issues"><img src="https://img.shields.io/github/issues/uiwjs/province-city-china.svg" alt="Github Issues"></a> <a href="https://github.comuiwjs/province-city-china/network"><img src="https://img.shields.io/github/forks/uiwjs/province-city-china.svg" alt="Github Forks"></a> <a href="https://github.com/uiwjs/province-city-china/stargazers"><img src="https://img.shields.io/github/stars/uiwjs/province-city-china.svg" alt="Github Stars"></a> <a href="https://github.com/uiwjs/province-city-china/releases"><img src="https://img.shields.io/github/release/uiwjs/province-city-china.svg" alt="Github Release"></a>
      <img src="http://jaywcjlove.github.io/sb/status/no-dependencies.svg" alt="no dependencies"> <a href="https://www.npmjs.com/package/province-city-china"><img src="https://img.shields.io/npm/v/province-city-china.svg" alt="npm package"></a>
    </p>
    <p>中华人民共和国行政区划(五级):省级、地级、县级、乡级和村级。来自中华人民共和国民政部,用于查询中国省,市和区数据的网站。</p>
    <pre><code class="code-highlight"><span class="code-line line-number" line="1">数据更新时间:2021/03/22 15:39:04 GMT+0800 (中国标准时间)
</span></code><div onclick="copied(this)" data-code="数据更新时间:2021/03/22 15:39:04 GMT+0800 (中国标准时间)
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <ul>
      <li><a href="http://www.mca.gov.cn/article/sj/xzqh/2020/">中华人民共和国行政区划代码,更新时间:2021-01-04</a></li>
      <li><a href="http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/">统计用区划和城乡划分代码,更新时间:2021-12-30</a></li>
      <li><a href="http://www.mohrss.gov.cn/SYrlzyhshbzb/zhuanti/jinbaogongcheng/Jbgcbiaozhunguifan/201112/t20111206_47429.html"><del>国家和地区代码列表(下载),更新时间:2011-12-06</del></a> 数据已被删除</li>
    </ul>
    <h3 id="数据更新-diff"><a class="anchor" aria-hidden="true" tabindex="-1" href="#数据更新-diff"><span class="octicon octicon-link"></span></a>数据更新 Diff</h3>
    <ul>
      <li><a href="https://github.com/uiwjs/province-city-china/compare/v8.2.0...v8.3.0">数据更新 2022/03/22</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/compare/v8.1.0...v8.2.0">数据更新 2022/03/22</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/compare/v8.0.0...v8.1.0">数据更新 2022/02/08</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/compare/v7.1.3...v8.0.0">数据更新 2021/05/11</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/compare/v6.1.1...v7.1.3">数据更新 2020/11/24</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/compare/v6.0.3...v6.1.1">数据更新 2020/11/05</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/commit/f511f4b">数据更新 2020/07/28</a> 县以上行政区【没变】,县以下发生变更</li>
      <li><a href="https://github.com/uiwjs/province-city-china/commit/14cb636">数据更新 2020/03/30</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/commit/eacab73">数据更新 2020/03/06</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/commit/85cde25">数据更新 2019/12/24</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/commit/d001be0">数据更新 2019/11/25</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/commit/5e9eeba854677018fcb7975dd460c86195b98ccc">数据更新 2019/11/05</a></li>
      <li><a href="https://github.com/uiwjs/province-city-china/commit/77408e62c1945cc3235f68f2b7c7f79be132bf99">数据更新 2019/06/21</a></li>
    </ul>
    <h3 id="安装"><a class="anchor" aria-hidden="true" tabindex="-1" href="#安装"><span class="octicon octicon-link"></span></a>安装</h3>
    <pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line line-number" line="1"><span class="token function">npm</span> <span class="token function">install</span> province-city-china --save-dev
</span></code><div onclick="copied(this)" data-code="npm install province-city-china --save-dev
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <table>
      <thead>
        <tr>
          <th>包名</th>
          <th>说明</th>
          <th>版本</th>
          <th>大小</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china">province-city-china</a></td>
          <td>包含所有包内容</td>
          <td><a href="https://www.npmjs.com/package/province-city-china"><img src="https://img.shields.io/npm/v/province-city-china.svg" alt="npm package"></a></td>
          <td>-</td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/country">@province-city-china/country</a></td>
          <td>国家和地区代码列表</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/country"><img src="https://img.shields.io/npm/v/@province-city-china/country.svg" alt="npm package"></a></td>
          <td>
            <img src="https://img.shields.io/bundlephobia/min/@province-city-china/country" alt="">
          </td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/data">@province-city-china/data</a></td>
          <td>总数据(省/地/县/乡)</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/data"><img src="https://img.shields.io/npm/v/@province-city-china/data.svg" alt="npm package"></a></td>
          <td>
            <img src="https://img.shields.io/bundlephobia/min/@province-city-china/data" alt="">
          </td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/province">@province-city-china/province</a></td>
          <td>省级(省/直辖市/特别行政区)</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/province"><img src="https://img.shields.io/npm/v/@province-city-china/province.svg" alt="npm package"></a></td>
          <td>
            <img src="https://img.shields.io/bundlephobia/min/@province-city-china/province" alt="">
          </td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/city">@province-city-china/city</a></td>
          <td>地级(城市)</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/city"><img src="https://img.shields.io/npm/v/@province-city-china/city.svg" alt="npm package"></a></td>
          <td>
            <img src="https://img.shields.io/bundlephobia/min/@province-city-china/city" alt="">
          </td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/area">@province-city-china/area</a></td>
          <td>县级(区县)</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/area"><img src="https://img.shields.io/npm/v/@province-city-china/area.svg" alt="npm package"></a></td>
          <td>
            <img src="https://img.shields.io/bundlephobia/min/@province-city-china/area" alt="">
          </td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/town">@province-city-china/town</a></td>
          <td>乡级(乡镇/街)</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/town"><img src="https://img.shields.io/npm/v/@province-city-china/town.svg" alt="npm package"></a></td>
          <td>
            <img src="https://img.shields.io/bundlephobia/min/@province-city-china/town" alt="">
          </td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/level">@province-city-china/level</a></td>
          <td>总数据(省/地/县/乡)层级数据</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/level"><img src="https://img.shields.io/npm/v/@province-city-china/level.svg" alt="npm package"></a></td>
          <td>
            <img src="https://img.shields.io/bundlephobia/min/@province-city-china/level" alt="">
          </td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/utils">@province-city-china/utils</a></td>
          <td>提供使用数据方法</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/utils"><img src="https://img.shields.io/npm/v/@province-city-china/utils.svg" alt="npm package"></a></td>
          <td>
            <img src="https://img.shields.io/bundlephobia/min/@province-city-china/utils" alt="">
          </td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/types">@province-city-china/types</a></td>
          <td>类型文件</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/types"><img src="https://img.shields.io/npm/v/@province-city-china/types.svg" alt="npm package"></a></td>
          <td>-</td>
        </tr>
        <tr>
          <td><a href="https://github.com/uiwjs/province-city-china/tree/master/packages/district-code">@province-city-china/district-code</a></td>
          <td>国内长途电话区号</td>
          <td><a href="https://www.npmjs.com/package/@province-city-china/district-code"><img src="https://img.shields.io/npm/v/@province-city-china/district-code.svg" alt="npm package"></a></td>
          <td>-</td>
        </tr>
      </tbody>
    </table>
    <h3 id="使用"><a class="anchor" aria-hidden="true" tabindex="-1" href="#使用"><span class="octicon octicon-link"></span></a>使用</h3>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">const</span> <span class="token punctuation">{</span> data<span class="token punctuation">,</span> province<span class="token punctuation">,</span> city<span class="token punctuation">,</span> area<span class="token punctuation">,</span> town <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'province-city-china/data'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</span></code><div onclick="copied(this)" data-code="const { data, province, city, area, town } = require(&#x27;province-city-china/data&#x27;);
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <ul>
      <li><code>data</code> - 总数据(省/地/县/乡)</li>
      <li><code>province</code> - 省级(省/直辖市/特别行政区)</li>
      <li><code>city</code> - 地级(城市)</li>
      <li><code>area</code> - 县级(区县)</li>
      <li><code>town</code> - 乡级(乡镇/街)</li>
    </ul>
    <p><strong>所有数据</strong></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">const</span> provinces <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'province-city-china/dist/data.json'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</span><span class="code-line line-number" line="2"><span class="token comment">// provinces 输出 ===></span>
</span><span class="code-line line-number" line="3"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="4">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"110000"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"北京市"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"11"</span><span class="token punctuation">,</span><span class="token string-property property">"city"</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string-property property">"area"</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">,</span><span class="token string-property property">"town"</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"110101"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"东城区"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"11"</span><span class="token punctuation">,</span><span class="token string-property property">"city"</span><span class="token operator">:</span><span class="token string">"01"</span><span class="token punctuation">,</span><span class="token string-property property">"area"</span><span class="token operator">:</span><span class="token string">"01"</span><span class="token punctuation">,</span><span class="token string-property property">"town"</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"110102"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"西城区"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"11"</span><span class="token punctuation">,</span><span class="token string-property property">"city"</span><span class="token operator">:</span><span class="token string">"01"</span><span class="token punctuation">,</span><span class="token string-property property">"area"</span><span class="token operator">:</span><span class="token string">"02"</span><span class="token punctuation">,</span><span class="token string-property property">"town"</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"110105"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"朝阳区"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"11"</span><span class="token punctuation">,</span><span class="token string-property property">"city"</span><span class="token operator">:</span><span class="token string">"01"</span><span class="token punctuation">,</span><span class="token string-property property">"area"</span><span class="token operator">:</span><span class="token string">"05"</span><span class="token punctuation">,</span><span class="token string-property property">"town"</span><span class="token operator">:</span><span class="token number">0</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="8">  <span class="token spread operator">...</span><span class="token punctuation">.</span>
</span><span class="code-line line-number" line="9"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="const provinces = require(&#x27;province-city-china/dist/data.json&#x27;);
// provinces 输出 ===>
[
  {&#x22;code&#x22;:&#x22;110000&#x22;,&#x22;name&#x22;:&#x22;北京市&#x22;,&#x22;province&#x22;:&#x22;11&#x22;,&#x22;city&#x22;:0,&#x22;area&#x22;:0,&#x22;town&#x22;:0},
  {&#x22;code&#x22;:&#x22;110101&#x22;,&#x22;name&#x22;:&#x22;东城区&#x22;,&#x22;province&#x22;:&#x22;11&#x22;,&#x22;city&#x22;:&#x22;01&#x22;,&#x22;area&#x22;:&#x22;01&#x22;,&#x22;town&#x22;:0},
  {&#x22;code&#x22;:&#x22;110102&#x22;,&#x22;name&#x22;:&#x22;西城区&#x22;,&#x22;province&#x22;:&#x22;11&#x22;,&#x22;city&#x22;:&#x22;01&#x22;,&#x22;area&#x22;:&#x22;02&#x22;,&#x22;town&#x22;:0},
  {&#x22;code&#x22;:&#x22;110105&#x22;,&#x22;name&#x22;:&#x22;朝阳区&#x22;,&#x22;province&#x22;:&#x22;11&#x22;,&#x22;city&#x22;:&#x22;01&#x22;,&#x22;area&#x22;:&#x22;05&#x22;,&#x22;town&#x22;:0},
  ....
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>规则:</p>
    <ul>
      <li><code>province - 省级(省/直辖市/特别行政区)</code> - <code>city=0</code>, <code>area=0</code>, <code>town=0</code></li>
      <li><code>city - 地级(城市)</code> - <code>area=0</code>, <code>town=0</code></li>
      <li><code>area - 县级(区县)</code> - <code>town=0</code> 其它不为 <code>0</code></li>
      <li><code>town - 乡级(乡镇/街)</code> - 所有值不为 <code>0</code></li>
    </ul>
    <blockquote>
      <p><code>province</code> 第一位表示:华北区<code>1</code>,东北区<code>2</code>,华东区<code>3</code>,中南区<code>4</code>,西南区<code>5</code>,西北区<code>6</code>。 如 <code>湖北省 -> 42</code> 以 <code>4</code> 开头,表示为 <code>中南区</code>。</p>
    </blockquote>
    <p><strong>获取城市数据</strong></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token keyword">const</span> city <span class="token operator">=</span> <span class="token function">require</span><span class="token punctuation">(</span><span class="token string">'province-city-china/dist/city.json'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
</span><span class="code-line line-number" line="2"><span class="token comment">// city 输出 ===></span>
</span><span class="code-line line-number" line="3"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="4">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"01"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"石家庄市"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"13"</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"02"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"唐山市"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"13"</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"03"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"秦皇岛市"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"13"</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"04"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"邯郸市"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"13"</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="8">  <span class="token punctuation">{</span><span class="token string-property property">"code"</span><span class="token operator">:</span><span class="token string">"05"</span><span class="token punctuation">,</span><span class="token string-property property">"name"</span><span class="token operator">:</span><span class="token string">"邢台市"</span><span class="token punctuation">,</span><span class="token string-property property">"province"</span><span class="token operator">:</span><span class="token string">"13"</span><span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="9">  <span class="token spread operator">...</span><span class="token punctuation">.</span>
</span><span class="code-line line-number" line="10"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="const city = require(&#x27;province-city-china/dist/city.json&#x27;);
// city 输出 ===>
[
  {&#x22;code&#x22;:&#x22;01&#x22;,&#x22;name&#x22;:&#x22;石家庄市&#x22;,&#x22;province&#x22;:&#x22;13&#x22;},
  {&#x22;code&#x22;:&#x22;02&#x22;,&#x22;name&#x22;:&#x22;唐山市&#x22;,&#x22;province&#x22;:&#x22;13&#x22;},
  {&#x22;code&#x22;:&#x22;03&#x22;,&#x22;name&#x22;:&#x22;秦皇岛市&#x22;,&#x22;province&#x22;:&#x22;13&#x22;},
  {&#x22;code&#x22;:&#x22;04&#x22;,&#x22;name&#x22;:&#x22;邯郸市&#x22;,&#x22;province&#x22;:&#x22;13&#x22;},
  {&#x22;code&#x22;:&#x22;05&#x22;,&#x22;name&#x22;:&#x22;邢台市&#x22;,&#x22;province&#x22;:&#x22;13&#x22;},
  ....
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>说明:</p>
    <ul>
      <li><code>code</code> - 城市代码</li>
      <li><code>name</code> - 城市名称</li>
      <li><code>province</code> - 省/直辖市/特别行政区代码</li>
    </ul>
    <h2 id="更多数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#更多数据"><span class="octicon octicon-link"></span></a>更多数据</h2>
    <blockquote>
      <p>可以通过 <a href="https://unpkg.com/province-city-china/dist/">UNPKG</a> 下载使用 <code>CDN</code> 资源: <a href="https://unpkg.com/province-city-china/dist/">https://unpkg.com/province-city-china/dist/</a></p>
    </blockquote>
    <table>
      <thead>
        <tr>
          <th>文件列表</th>
          <th>JSON</th>
          <th>CSV</th>
          <th>SQL</th>
          <th>CDN</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>国家和地区代码列表(<a href="https://github.com/uiwjs/province-city-china/issues/13">#13</a>)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/country.json">country.json</a> (<a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/country.min.json">min</a>)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/country.csv">country.csv</a></td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/country.csv">csv</a> / <a href="https://unpkg.com/province-city-china/dist/country.json">json</a></td>
        </tr>
        <tr>
          <td>总数据(省/地/县/乡)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.json">data.json</a> (<a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.min.json">min</a>)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.csv">data.csv</a></td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.sql">data.sql</a></td>
          <td><a href="https://unpkg.com/province-city-china/dist/data.sql">data.sql</a> / <a href="https://unpkg.com/province-city-china/dist/data.csv">csv</a> / <a href="https://unpkg.com/province-city-china/dist/data.json">json</a></td>
        </tr>
        <tr>
          <td>总数据(省/地/县/乡)层级数据</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/level.json">level.json</a> (<a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/level.min.json">min</a>)</td>
          <td>-</td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/level.json">level.json</a></td>
        </tr>
        <tr>
          <td>省级(省/直辖市/特别行政区)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/province.json">province.json</a> (<a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/province.min.json">min</a>)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/province.csv">province.csv</a></td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/province.json">province.json</a> / <a href="https://unpkg.com/province-city-china/dist/province.csv">csv</a></td>
        </tr>
        <tr>
          <td>地级(城市)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.json">city.json</a> (<a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.min.json">min</a>)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.csv">city.csv</a></td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/city.json">city.json</a> / <a href="https://unpkg.com/province-city-china/dist/city.csv">csv</a></td>
        </tr>
        <tr>
          <td>县级(区县)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/area.json">area.json</a> (<a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/area.min.json">min</a>)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/area.csv">area.csv</a></td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/area.json">area.json</a> / <a href="https://unpkg.com/province-city-china/dist/area.csv">csv</a></td>
        </tr>
        <tr>
          <td>乡级(乡镇/街)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/town.json">town.json</a> (<a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/town.min.json">min</a>)</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/town.csv">town.csv</a></td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/town.json">town.json</a> / <a href="https://unpkg.com/province-city-china/dist/town.csv">csv</a></td>
        </tr>
        <tr>
          <td>县市区没有乡级数据</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/not-found-town.json">not-found-town.json</a> (<a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/not-found-town.min.json">min</a>)</td>
          <td>-</td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/not-found-town.json">not-found-town.json</a></td>
        </tr>
        <tr>
          <td>香港澳门&#x3C;区>数据</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/hongkong.json">hongkong.json</a><br><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/macau.json">macau.json</a></td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/hongkong.csv">hongkong.csv</a> / <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/macau.csv">macau.csv</a></td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/hongkong.json">hongkong.json</a> (<a href="https://unpkg.com/province-city-china/dist/hongkong.csv">csv</a>)<br><a href="https://unpkg.com/province-city-china/dist/macau.json">macau.json</a> (<a href="https://unpkg.com/province-city-china/dist/macau.csv">csv</a>)</td>
        </tr>
        <tr>
          <td>国内长途电话区号</td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/district-code.json">district-code.json</a></td>
          <td><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/district-code.csv">district-code.csv</a></td>
          <td>-</td>
          <td><a href="https://unpkg.com/province-city-china/dist/district-code.json">district-code.json</a> / <a href="https://unpkg.com/province-city-china/dist/district-code.csv">csv</a></td>
        </tr>
      </tbody>
    </table>
    <p>更多 CDN 数据访问</p>
    <ul>
      <li><a href="https://unpkg.com/province-city-china/dist/city.json">https://unpkg.com/province-city-china/dist/city.json</a></li>
      <li><a href="https://raw.githack.com/uiwjs/province-city-china/gh-pages/city.json">https://raw.githack.com/uiwjs/province-city-china/gh-pages/city.json</a></li>
      <li><a href="https://cdn.statically.io/gh/uiwjs/province-city-china/gh-pages/city.json">https://cdn.statically.io/gh/uiwjs/province-city-china/gh-pages/city.json</a></li>
    </ul>
    <pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line line-number" line="1">✅ <span class="token operator">></span> <span class="token operator">&#x3C;</span>省<span class="token operator">></span>数据:34
</span><span class="code-line line-number" line="2">  ✔ 数据保存: data/province.json
</span><span class="code-line line-number" line="3">  ✔ 数据保存: data/province.csv
</span><span class="code-line line-number" line="4">  ✔ 数据保存: data/province.min.json
</span><span class="code-line line-number" line="5">✅ <span class="token operator">></span> <span class="token operator">&#x3C;</span>市<span class="token operator">></span>数据:337
</span><span class="code-line line-number" line="6">  ✔ 数据保存: data/city.json
</span><span class="code-line line-number" line="7">  ✔ 数据保存: data/city.csv
</span><span class="code-line line-number" line="8">  ✔ 数据保存: data/city.min.json
</span><span class="code-line line-number" line="9">✅ <span class="token operator">></span> <span class="token operator">&#x3C;</span>区<span class="token operator">></span>数据:2846
</span><span class="code-line line-number" line="10">  ✔ 数据保存: data/area.json
</span><span class="code-line line-number" line="11">  ✔ 数据保存: data/area.csv
</span><span class="code-line line-number" line="12">  ✔ 数据保存: data/area.min.json
</span><span class="code-line line-number" line="13">✅ <span class="token operator">></span> <span class="token operator">&#x3C;</span>省<span class="token operator">></span><span class="token operator">&#x3C;</span>市<span class="token operator">></span><span class="token operator">&#x3C;</span>区<span class="token operator">></span>总数据:3217
</span><span class="code-line line-number" line="14">  ✔ 数据保存: data/data.json
</span><span class="code-line line-number" line="15">  ✔ 数据保存: data/data.min.json
</span><span class="code-line line-number" line="16">  ✔ 数据保存: data/data.csv
</span><span class="code-line line-number" line="17">✅ <span class="token operator">></span> <span class="token operator">&#x3C;</span>省市区<span class="token operator">></span>层级数据:
</span><span class="code-line line-number" line="18">  ✔ 数据保存: data/level.json
</span><span class="code-line line-number" line="19">  ✔ 数据保存: data/level.min.json
</span></code><div onclick="copied(this)" data-code="✅ > <省>数据:34
  ✔ 数据保存: data/province.json
  ✔ 数据保存: data/province.csv
  ✔ 数据保存: data/province.min.json
✅ > <市>数据:337
  ✔ 数据保存: data/city.json
  ✔ 数据保存: data/city.csv
  ✔ 数据保存: data/city.min.json
✅ > <区>数据:2846
  ✔ 数据保存: data/area.json
  ✔ 数据保存: data/area.csv
  ✔ 数据保存: data/area.min.json
✅ > <省><市><区>总数据:3217
  ✔ 数据保存: data/data.json
  ✔ 数据保存: data/data.min.json
  ✔ 数据保存: data/data.csv
✅ > <省市区>层级数据:
  ✔ 数据保存: data/level.json
  ✔ 数据保存: data/level.min.json
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="国家和地区代码列表"><a class="anchor" aria-hidden="true" tabindex="-1" href="#国家和地区代码列表"><span class="octicon octicon-link"></span></a>国家和地区代码列表</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/country.json">country.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/country.min.json">country.min.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/country.csv">country.csv</a></p>
    <p><kbd>id=序号</kbd>、<kbd>cnname=中文简称</kbd>、<kbd>name=英文简称</kbd>、<kbd>fullname=英文全称</kbd>、<kbd>alpha2=两字母代码</kbd>、<kbd>alpha3=三字母代码</kbd>、<kbd>numeric=数字代码</kbd></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"id"</span><span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"cnname"</span><span class="token operator">:</span> <span class="token string">"阿富汗"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"Afghanistan"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">    <span class="token string-property property">"fullname"</span><span class="token operator">:</span> <span class="token string">"the Islamic Republic of Afghanistan"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">    <span class="token string-property property">"alpha2"</span><span class="token operator">:</span> <span class="token string">"AF"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="8">    <span class="token string-property property">"alpha3"</span><span class="token operator">:</span> <span class="token string">"AFG"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="9">    <span class="token string-property property">"town"</span><span class="token operator">:</span> <span class="token number">4</span>
</span><span class="code-line line-number" line="10">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="11">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="12">    <span class="token string-property property">"id"</span><span class="token operator">:</span> <span class="token number">45</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="13">    <span class="token string-property property">"cnname"</span><span class="token operator">:</span> <span class="token string">"中国"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="14">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"China"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="15">    <span class="token string-property property">"fullname"</span><span class="token operator">:</span> <span class="token string">"the People's Republic of China"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="16">    <span class="token string-property property">"alpha2"</span><span class="token operator">:</span> <span class="token string">"CN"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="17">    <span class="token string-property property">"alpha3"</span><span class="token operator">:</span> <span class="token string">"CHN"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="18">    <span class="token string-property property">"town"</span><span class="token operator">:</span> <span class="token number">156</span>
</span><span class="code-line line-number" line="19">  <span class="token punctuation">}</span>
</span><span class="code-line line-number" line="20">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="21"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;id&#x22;: 1,
    &#x22;cnname&#x22;: &#x22;阿富汗&#x22;,
    &#x22;name&#x22;: &#x22;Afghanistan&#x22;,
    &#x22;fullname&#x22;: &#x22;the Islamic Republic of Afghanistan&#x22;,
    &#x22;alpha2&#x22;: &#x22;AF&#x22;,
    &#x22;alpha3&#x22;: &#x22;AFG&#x22;,
    &#x22;town&#x22;: 4
  },
  {
    &#x22;id&#x22;: 45,
    &#x22;cnname&#x22;: &#x22;中国&#x22;,
    &#x22;name&#x22;: &#x22;China&#x22;,
    &#x22;fullname&#x22;: &#x22;the People&#x27;s Republic of China&#x22;,
    &#x22;alpha2&#x22;: &#x22;CN&#x22;,
    &#x22;alpha3&#x22;: &#x22;CHN&#x22;,
    &#x22;town&#x22;: 156
  }
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>压缩数据说明 <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/country.min.json">country.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token literal-property property">id</span><span class="token operator">:</span> <span class="token string">'i'</span>
</span><span class="code-line line-number" line="2"><span class="token literal-property property">cnname</span><span class="token operator">:</span> <span class="token string">'c'</span>
</span><span class="code-line line-number" line="3"><span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'n'</span>
</span><span class="code-line line-number" line="4"><span class="token literal-property property">fullname</span><span class="token operator">:</span> <span class="token string">'f'</span>
</span><span class="code-line line-number" line="5"><span class="token literal-property property">alpha2</span><span class="token operator">:</span> <span class="token string">'a2'</span>
</span><span class="code-line line-number" line="6"><span class="token literal-property property">alpha3</span><span class="token operator">:</span> <span class="token string">'a3'</span>
</span><span class="code-line line-number" line="7"><span class="token literal-property property">numeric</span><span class="token operator">:</span> <span class="token string">'r'</span>
</span></code><div onclick="copied(this)" data-code="id: &#x27;i&#x27;
cnname: &#x27;c&#x27;
name: &#x27;n&#x27;
fullname: &#x27;f&#x27;
alpha2: &#x27;a2&#x27;
alpha3: &#x27;a3&#x27;
numeric: &#x27;r&#x27;
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="总数据省地县乡"><a class="anchor" aria-hidden="true" tabindex="-1" href="#总数据省地县乡"><span class="octicon octicon-link"></span></a>总数据(省/地/县/乡)</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.json">data.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.min.json">data.min.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.csv">data.csv</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.sql">data.sql</a></p>
    <p>包含香港澳门&#x3C;区>数据</p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"110000"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"北京市"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"11"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">    <span class="token string-property property">"city"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">    <span class="token string-property property">"area"</span><span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="8">    <span class="token string-property property">"town"</span><span class="token operator">:</span> <span class="token number">0</span>
</span><span class="code-line line-number" line="9">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="10">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="11"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;code&#x22;: &#x22;110000&#x22;,
    &#x22;name&#x22;: &#x22;北京市&#x22;,
    &#x22;province&#x22;: &#x22;11&#x22;,
    &#x22;city&#x22;: 0,
    &#x22;area&#x22;: 0,
    &#x22;town&#x22;: 0
  },
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>压缩数据说明 <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/data.min.json">data.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'c'</span>
</span><span class="code-line line-number" line="2"><span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'n'</span>
</span><span class="code-line line-number" line="3"><span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'p'</span>
</span><span class="code-line line-number" line="4"><span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'y'</span>
</span><span class="code-line line-number" line="5"><span class="token literal-property property">area</span><span class="token operator">:</span> <span class="token string">'a'</span>
</span><span class="code-line line-number" line="6"><span class="token literal-property property">town</span><span class="token operator">:</span> <span class="token string">'t'</span>
</span></code><div onclick="copied(this)" data-code="code: &#x27;c&#x27;
name: &#x27;n&#x27;
province: &#x27;p&#x27;
city: &#x27;y&#x27;
area: &#x27;a&#x27;
town: &#x27;t&#x27;
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="省地县乡层级数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#省地县乡层级数据"><span class="octicon octicon-link"></span></a>省/地/县/乡层级数据</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/level.json">level.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/level.min.json">level.min.json</a></p>
    <p>包含香港澳门&#x3C;区>数据</p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"420000"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"湖北省"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"42"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">    <span class="token string-property property">"children"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
</span><span class="code-line line-number" line="7">      <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="8">        <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"420100"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="9">        <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"武汉市"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="10">        <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"42"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="11">        <span class="token string-property property">"city"</span><span class="token operator">:</span> <span class="token string">"01"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="12">        <span class="token string-property property">"children"</span><span class="token operator">:</span> <span class="token punctuation">[</span>
</span><span class="code-line line-number" line="13">          <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="14">            <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"420102"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="15">            <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"江岸区"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="16">            <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"42"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="17">            <span class="token string-property property">"city"</span><span class="token operator">:</span> <span class="token string">"01"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="18">            <span class="token string-property property">"area"</span><span class="token operator">:</span> <span class="token string">"02"</span>
</span><span class="code-line line-number" line="19">          <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="20">          <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="21">        <span class="token punctuation">]</span>
</span><span class="code-line line-number" line="22">      <span class="token punctuation">}</span>
</span><span class="code-line line-number" line="23">      <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="24">    <span class="token punctuation">]</span>
</span><span class="code-line line-number" line="25">  <span class="token punctuation">}</span>
</span><span class="code-line line-number" line="26">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="27"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;code&#x22;: &#x22;420000&#x22;,
    &#x22;name&#x22;: &#x22;湖北省&#x22;,
    &#x22;province&#x22;: &#x22;42&#x22;,
    &#x22;children&#x22;: [
      {
        &#x22;code&#x22;: &#x22;420100&#x22;,
        &#x22;name&#x22;: &#x22;武汉市&#x22;,
        &#x22;province&#x22;: &#x22;42&#x22;,
        &#x22;city&#x22;: &#x22;01&#x22;,
        &#x22;children&#x22;: [
          {
            &#x22;code&#x22;: &#x22;420102&#x22;,
            &#x22;name&#x22;: &#x22;江岸区&#x22;,
            &#x22;province&#x22;: &#x22;42&#x22;,
            &#x22;city&#x22;: &#x22;01&#x22;,
            &#x22;area&#x22;: &#x22;02&#x22;
          },
          // ...
        ]
      }
      // ...
    ]
  }
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>压缩数据说明 <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/level.min.json">level.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'c'</span>
</span><span class="code-line line-number" line="2"><span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'n'</span>
</span><span class="code-line line-number" line="3"><span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'p'</span>
</span><span class="code-line line-number" line="4"><span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'y'</span>
</span><span class="code-line line-number" line="5"><span class="token literal-property property">area</span><span class="token operator">:</span> <span class="token string">'a'</span>
</span><span class="code-line line-number" line="6"><span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token string">'d'</span>
</span></code><div onclick="copied(this)" data-code="code: &#x27;c&#x27;
name: &#x27;n&#x27;
province: &#x27;p&#x27;
city: &#x27;y&#x27;
area: &#x27;a&#x27;
children: &#x27;d&#x27;
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="省级省直辖市特别行政区"><a class="anchor" aria-hidden="true" tabindex="-1" href="#省级省直辖市特别行政区"><span class="octicon octicon-link"></span></a>省级(省/直辖市/特别行政区)</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/province.json">province.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/province.min.json">province.min.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/province.csv">province.csv</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"110000"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"北京市"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"11"</span>
</span><span class="code-line line-number" line="6">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="8">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"120000"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="9">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"天津市"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="10">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"12"</span>
</span><span class="code-line line-number" line="11">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="12">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="13"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;code&#x22;: &#x22;110000&#x22;,
    &#x22;name&#x22;: &#x22;北京市&#x22;,
    &#x22;province&#x22;: &#x22;11&#x22;
  },
  {
    &#x22;code&#x22;: &#x22;120000&#x22;,
    &#x22;name&#x22;: &#x22;天津市&#x22;,
    &#x22;province&#x22;: &#x22;12&#x22;
  },
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>压缩数据说明 <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/level.min.json">level.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'c'</span>
</span><span class="code-line line-number" line="2"><span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'n'</span>
</span><span class="code-line line-number" line="3"><span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'p'</span>
</span><span class="code-line line-number" line="4"><span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'y'</span>
</span><span class="code-line line-number" line="5"><span class="token literal-property property">area</span><span class="token operator">:</span> <span class="token string">'a'</span>
</span><span class="code-line line-number" line="6"><span class="token literal-property property">children</span><span class="token operator">:</span> <span class="token string">'d'</span>
</span></code><div onclick="copied(this)" data-code="code: &#x27;c&#x27;
name: &#x27;n&#x27;
province: &#x27;p&#x27;
city: &#x27;y&#x27;
area: &#x27;a&#x27;
children: &#x27;d&#x27;
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="地级城市"><a class="anchor" aria-hidden="true" tabindex="-1" href="#地级城市"><span class="octicon octicon-link"></span></a>地级(城市)</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.json">city.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.min.json">city.min.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.csv">city.csv</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"130100"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"石家庄市"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"13"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">    <span class="token string-property property">"city"</span><span class="token operator">:</span> <span class="token string">"01"</span>
</span><span class="code-line line-number" line="7">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="8">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="9"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;code&#x22;: &#x22;130100&#x22;,
    &#x22;name&#x22;: &#x22;石家庄市&#x22;,
    &#x22;province&#x22;: &#x22;13&#x22;,
    &#x22;city&#x22;: &#x22;01&#x22;
  },
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>压缩数据说明 <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.min.json">city.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'c'</span>
</span><span class="code-line line-number" line="2"><span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'n'</span>
</span><span class="code-line line-number" line="3"><span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'p'</span>
</span><span class="code-line line-number" line="4"><span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'y'</span>
</span></code><div onclick="copied(this)" data-code="code: &#x27;c&#x27;
name: &#x27;n&#x27;
province: &#x27;p&#x27;
city: &#x27;y&#x27;
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="县级区县"><a class="anchor" aria-hidden="true" tabindex="-1" href="#县级区县"><span class="octicon octicon-link"></span></a>县级(区县)</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/area.json">area.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/area.min.json">area.min.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/area.csv">area.csv</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"110101"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"东城区"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"11"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">    <span class="token string-property property">"city"</span><span class="token operator">:</span> <span class="token string">"01"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">    <span class="token string-property property">"area"</span><span class="token operator">:</span> <span class="token string">"01"</span>
</span><span class="code-line line-number" line="8">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="9">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="10"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;code&#x22;: &#x22;110101&#x22;,
    &#x22;name&#x22;: &#x22;东城区&#x22;,
    &#x22;province&#x22;: &#x22;11&#x22;,
    &#x22;city&#x22;: &#x22;01&#x22;,
    &#x22;area&#x22;: &#x22;01&#x22;
  },
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>压缩数据说明 <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.min.json">city.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'c'</span>
</span><span class="code-line line-number" line="2"><span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'n'</span>
</span><span class="code-line line-number" line="3"><span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'p'</span>
</span><span class="code-line line-number" line="4"><span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'y'</span>
</span><span class="code-line line-number" line="5"><span class="token literal-property property">area</span><span class="token operator">:</span> <span class="token string">'a'</span>
</span></code><div onclick="copied(this)" data-code="code: &#x27;c&#x27;
name: &#x27;n&#x27;
province: &#x27;p&#x27;
city: &#x27;y&#x27;
area: &#x27;a&#x27;
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="乡级乡镇街"><a class="anchor" aria-hidden="true" tabindex="-1" href="#乡级乡镇街"><span class="octicon octicon-link"></span></a>乡级(乡镇/街)</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/town.json">town.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/town.min.json">town.min.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/town.csv">town.csv</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"110101001000"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"东华门街道"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"11"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">    <span class="token string-property property">"city"</span><span class="token operator">:</span> <span class="token string">"01"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">    <span class="token string-property property">"area"</span><span class="token operator">:</span> <span class="token string">"01"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="8">    <span class="token string-property property">"town"</span><span class="token operator">:</span> <span class="token string">"001000"</span>
</span><span class="code-line line-number" line="9">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="10">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="11"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;code&#x22;: &#x22;110101001000&#x22;,
    &#x22;name&#x22;: &#x22;东华门街道&#x22;,
    &#x22;province&#x22;: &#x22;11&#x22;,
    &#x22;city&#x22;: &#x22;01&#x22;,
    &#x22;area&#x22;: &#x22;01&#x22;,
    &#x22;town&#x22;: &#x22;001000&#x22;
  },
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>压缩数据说明 <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/city.min.json">city.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'c'</span>
</span><span class="code-line line-number" line="2"><span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'n'</span>
</span><span class="code-line line-number" line="3"><span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'p'</span>
</span><span class="code-line line-number" line="4"><span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'y'</span>
</span><span class="code-line line-number" line="5"><span class="token literal-property property">area</span><span class="token operator">:</span> <span class="token string">'a'</span>
</span><span class="code-line line-number" line="6"><span class="token literal-property property">town</span><span class="token operator">:</span> <span class="token string">'t'</span>
</span></code><div onclick="copied(this)" data-code="code: &#x27;c&#x27;
name: &#x27;n&#x27;
province: &#x27;p&#x27;
city: &#x27;y&#x27;
area: &#x27;a&#x27;
town: &#x27;t&#x27;
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="县市区没有乡级数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#县市区没有乡级数据"><span class="octicon octicon-link"></span></a>县市区没有乡级数据</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/not-found-town.json">not-found-town.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/not-found-town.min.json">not-found-town.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"659010"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"胡杨河市"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"65"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">    <span class="token string-property property">"city"</span><span class="token operator">:</span> <span class="token string">"90"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">    <span class="token string-property property">"area"</span><span class="token operator">:</span> <span class="token string">"10"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="8">    <span class="token string-property property">"town"</span><span class="token operator">:</span> <span class="token number">0</span>
</span><span class="code-line line-number" line="9">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="10">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="11"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;code&#x22;: &#x22;659010&#x22;,
    &#x22;name&#x22;: &#x22;胡杨河市&#x22;,
    &#x22;province&#x22;: &#x22;65&#x22;,
    &#x22;city&#x22;: &#x22;90&#x22;,
    &#x22;area&#x22;: &#x22;10&#x22;,
    &#x22;town&#x22;: 0
  },
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>压缩数据说明 <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/not-found-town.min.json">not-found-town.min.json</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'c'</span>
</span><span class="code-line line-number" line="2"><span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'n'</span>
</span><span class="code-line line-number" line="3"><span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'p'</span>
</span><span class="code-line line-number" line="4"><span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'y'</span>
</span><span class="code-line line-number" line="5"><span class="token literal-property property">area</span><span class="token operator">:</span> <span class="token string">'a'</span>
</span><span class="code-line line-number" line="6"><span class="token literal-property property">town</span><span class="token operator">:</span> <span class="token string">'t'</span>
</span></code><div onclick="copied(this)" data-code="code: &#x27;c&#x27;
name: &#x27;n&#x27;
province: &#x27;p&#x27;
city: &#x27;y&#x27;
area: &#x27;a&#x27;
town: &#x27;t&#x27;
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="香港澳门区数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#香港澳门区数据"><span class="octicon octicon-link"></span></a>香港澳门&#x3C;区>数据</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/hongkong.json">hongkong.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/hongkong.csv">hongkong.csv</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/macau.json">macau.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/macau.csv">macau.csv</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span>
</span><span class="code-line line-number" line="3">    <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"810002"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">    <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"湾仔区"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">    <span class="token string-property property">"province"</span><span class="token operator">:</span> <span class="token string">"81"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="6">    <span class="token string-property property">"city"</span><span class="token operator">:</span> <span class="token string">"00"</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="7">    <span class="token string-property property">"area"</span><span class="token operator">:</span> <span class="token string">"02"</span>
</span><span class="code-line line-number" line="8">  <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="9">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="10"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  {
    &#x22;code&#x22;: &#x22;810002&#x22;,
    &#x22;name&#x22;: &#x22;湾仔区&#x22;,
    &#x22;province&#x22;: &#x22;81&#x22;,
    &#x22;city&#x22;: &#x22;00&#x22;,
    &#x22;area&#x22;: &#x22;02&#x22;
  },
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="国内长途电话区号"><a class="anchor" aria-hidden="true" tabindex="-1" href="#国内长途电话区号"><span class="octicon octicon-link"></span></a>国内长途电话区号</h3>
    <p><a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/district-code.json">district-code.json</a> | <a href="https://github.com/uiwjs/province-city-china/blob/gh-pages/district-code.csv">district-code.csv</a></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span> <span class="token string-property property">"name"</span><span class="token operator">:</span> <span class="token string">"北京市"</span><span class="token punctuation">,</span> <span class="token string-property property">"code"</span><span class="token operator">:</span> <span class="token string">"010"</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="3">  <span class="token comment">// ...</span>
</span><span class="code-line line-number" line="4"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  { &#x22;name&#x22;: &#x22;北京市&#x22;, &#x22;code&#x22;: &#x22;010&#x22; },
  // ...
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h2 id="脚本获取数据说明"><a class="anchor" aria-hidden="true" tabindex="-1" href="#脚本获取数据说明"><span class="octicon octicon-link"></span></a>脚本获取数据说明</h2>
    <h3 id="-获取省市数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#-获取省市数据"><span class="octicon octicon-link"></span></a>① 获取&#x3C;省>&#x3C;市>数据</h3>
    <p>在 <a href="http://www.mca.gov.cn/article/sj/xzqh/2020/20201201.html">中华人民共和国民政部-总省市区数据</a> 上有完整的公开省市区数据。</p>
    <p>获取省数据: <a href="http://www.mca.gov.cn/article/sj/xzqh/2020/20201201.html">http://www.mca.gov.cn/article/sj/xzqh/2020/20201201.html</a></p>
    <h3 id="-校验四个自治区直辖县级行政区划--以及其它数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#-校验四个自治区直辖县级行政区划--以及其它数据"><span class="octicon octicon-link"></span></a>② 校验四个&#x3C;自治区直辖县级行政区划> &#x26; 以及其它数据</h3>
    <p>省市区数据来源于 <del><a href="http://www.mca.gov.cn/article/sj/xzqh/2020/20201201.html">中华人民共和国民政部-总省市区数据</a></del>,数据太老,<code>自治区直辖县级行政区划</code> 中有数据不存在,校验此数据。</p>
    <p>🚧 注意:部分省份下面有 <code>省直辖县级行政区划</code> 如(<a href="http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2021/42.html">湖北省</a>、<a href="http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2021/41.html">河南省</a>等),需要将此部分数据重新爬下来进行校验数据,如 [<code>新疆维吾尔自治区-自治区直辖县级行政区划</code>] 缺 <code>新星市</code>。</p>
    <p>为提升速度,通过 <code>标记</code> 校验哪些特殊省份有这类数据。</p>
    <pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line line-number" line="1">http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2021/<span class="token operator">&#x3C;</span>省<span class="token operator">></span>/<span class="token operator">&#x3C;</span>省<span class="token operator">></span><span class="token operator">&#x3C;</span>自治区直辖县级行政区划<span class="token operator">></span>.html
</span><span class="code-line line-number" line="2">
</span><span class="code-line line-number" line="3">- <span class="token number">42</span> 湖北省         -<span class="token operator">></span> <span class="token comment"># 自治区直辖县级行政区划</span>
</span><span class="code-line line-number" line="4">- <span class="token number">46</span> 海南省         -<span class="token operator">></span> <span class="token comment"># 自治区直辖县级行政区划</span>
</span><span class="code-line line-number" line="5">- <span class="token number">65</span> 新疆维吾尔自治区 -<span class="token operator">></span> <span class="token comment"># 自治区直辖县级行政区划</span>
</span><span class="code-line line-number" line="6">- <span class="token number">41</span> 河南省         -<span class="token operator">></span> <span class="token comment"># 省直辖县级行政区划</span>
</span><span class="code-line line-number" line="7"><span class="token comment"># - 46 重庆市 -> 🚧 县</span>
</span><span class="code-line line-number" line="8"><span class="token comment"># - 23 黑龙江省 -> 🚧 大兴安岭地区</span>
</span></code><div onclick="copied(this)" data-code="http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/2021/<省>/<省><自治区直辖县级行政区划>.html

- 42 湖北省         -> # 自治区直辖县级行政区划
- 46 海南省         -> # 自治区直辖县级行政区划
- 65 新疆维吾尔自治区 -> # 自治区直辖县级行政区划
- 41 河南省         -> # 省直辖县级行政区划
# - 46 重庆市 -> 🚧 县
# - 23 黑龙江省 -> 🚧 大兴安岭地区
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>上面 <code>4</code> 个省区比较特殊的 <code>自治区直辖县级行政区划</code>,都有独立的 <code>城市</code> 代码,里面的数据拥有 <code>区</code> 代码,所以放到 <code>区</code> 数据中,例如:湖北省的 <code>自治区直辖县级行政区划</code> 编码为 <code>90</code></p>
    <pre class="language-js"><code class="language-js code-highlight"><span class="code-line line-number" line="1"><span class="token punctuation">[</span>
</span><span class="code-line line-number" line="2">  <span class="token punctuation">{</span> <span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'429004'</span><span class="token punctuation">,</span> <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'仙桃市'</span><span class="token punctuation">,</span> <span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'42'</span><span class="token punctuation">,</span> <span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'90'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="3">  <span class="token punctuation">{</span> <span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'429005'</span><span class="token punctuation">,</span> <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'潜江市'</span><span class="token punctuation">,</span> <span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'42'</span><span class="token punctuation">,</span> <span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'90'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="4">  <span class="token punctuation">{</span> <span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'429006'</span><span class="token punctuation">,</span> <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'天门市'</span><span class="token punctuation">,</span> <span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'42'</span><span class="token punctuation">,</span> <span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'90'</span> <span class="token punctuation">}</span><span class="token punctuation">,</span>
</span><span class="code-line line-number" line="5">  <span class="token punctuation">{</span> <span class="token literal-property property">code</span><span class="token operator">:</span> <span class="token string">'429021'</span><span class="token punctuation">,</span> <span class="token literal-property property">name</span><span class="token operator">:</span> <span class="token string">'神农架林区'</span><span class="token punctuation">,</span> <span class="token literal-property property">province</span><span class="token operator">:</span> <span class="token string">'42'</span><span class="token punctuation">,</span> <span class="token literal-property property">city</span><span class="token operator">:</span> <span class="token string">'90'</span> <span class="token punctuation">}</span>
</span><span class="code-line line-number" line="6"><span class="token punctuation">]</span>
</span></code><div onclick="copied(this)" data-code="[
  { code: &#x27;429004&#x27;, name: &#x27;仙桃市&#x27;, province: &#x27;42&#x27;, city: &#x27;90&#x27; },
  { code: &#x27;429005&#x27;, name: &#x27;潜江市&#x27;, province: &#x27;42&#x27;, city: &#x27;90&#x27; },
  { code: &#x27;429006&#x27;, name: &#x27;天门市&#x27;, province: &#x27;42&#x27;, city: &#x27;90&#x27; },
  { code: &#x27;429021&#x27;, name: &#x27;神农架林区&#x27;, province: &#x27;42&#x27;, city: &#x27;90&#x27; }
]
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <h3 id="-处理四个北京市上海市天津市重庆市直辖市数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#-处理四个北京市上海市天津市重庆市直辖市数据"><span class="octicon octicon-link"></span></a>③ 处理四个&#x3C;北京市|上海市|天津市|重庆市>直辖市数据</h3>
    <p>在 ① 步已获取直辖市数据:<a href="http://www.mca.gov.cn/article/sj/xzqh/2020/20201201.html">http://www.mca.gov.cn/article/sj/xzqh/2020/20201201.html</a></p>
    <p>🚧 这里只是在生成层级数据的时候,需要特殊处理,因为它只有市区数据。</p>
    <h3 id="-分别存储省市区数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#-分别存储省市区数据"><span class="octicon octicon-link"></span></a>④ 分别存储&#x3C;省>&#x3C;市>&#x3C;区>数据</h3>
    <p>分别存储 &#x3C;省>&#x3C;市>&#x3C;区> 提供 <code>csv</code>, <code>min.json</code>, <code>level.json</code>, <code>level.min.json</code> 等数据。</p>
    <h3 id="-缓存区数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#-缓存区数据"><span class="octicon octicon-link"></span></a>⑤ 缓存&#x3C;区>数据</h3>
    <p>此数据用于&#x3C;街道>数据获取,避免中断从头爬数据。</p>
    <h3 id="-通过街道数据获取街道数据"><a class="anchor" aria-hidden="true" tabindex="-1" href="#-通过街道数据获取街道数据"><span class="octicon octicon-link"></span></a>⑥ 通过&#x3C;街道>数据获取街道数据</h3>
    <pre class="language-bash"><code class="language-bash code-highlight"><span class="code-line line-number" line="1">□□□□□□  □□□  □□□
</span><span class="code-line line-number" line="2">┈┈┬┈┈┈  ┈┬┈  ┈┬┈
</span><span class="code-line line-number" line="3">  ╰┈┈┈┈┈┈┆┈┈┈┈┆┈┈┈┈→ ¹<span class="token operator">&#x3C;</span>省市区<span class="token operator">></span>代码
</span><span class="code-line line-number" line="4">         ╰┈┈┈┈┆┈┈┈┈→ ²<span class="token operator">&#x3C;</span>乡镇街道<span class="token operator">></span>代码
</span><span class="code-line line-number" line="5">              ╰┈┈┈┈→ ³<span class="token operator">&#x3C;</span>居民委员会<span class="token operator">></span>和<span class="token operator">&#x3C;</span>村民委员会<span class="token operator">></span>的代码
</span></code><div onclick="copied(this)" data-code="□□□□□□  □□□  □□□
┈┈┬┈┈┈  ┈┬┈  ┈┬┈
  ╰┈┈┈┈┈┈┆┈┈┈┈┆┈┈┈┈→ ¹<省市区>代码
         ╰┈┈┈┈┆┈┈┈┈→ ²<乡镇街道>代码
              ╰┈┈┈┈→ ³<居民委员会>和<村民委员会>的代码
" class="copied"><svg class="octicon-copy" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 010 1.5h-1.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-1.5a.75.75 0 011.5 0v1.5A1.75 1.75 0 019.25 16h-7.5A1.75 1.75 0 010 14.25v-7.5z"></path><path fill-rule="evenodd" d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0114.25 11h-7.5A1.75 1.75 0 015 9.25v-7.5zm1.75-.25a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 00.25-.25v-7.5a.25.25 0 00-.25-.25h-7.5z"></path></svg><svg class="octicon-check" aria-hidden="true" viewBox="0 0 16 16" fill="currentColor" height="12" width="12"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg></div></pre>
    <p>第²二段代码</p>
    <ol>
      <li>001—099 表示街道的代码,应在本地区的范围内由小到大顺序编写;</li>
      <li>100—199 表示镇的代码,应在本地区的范围内由小到大顺序编写;</li>
      <li>200—399 表示乡的代码,应在本地区的范围内由小到大顺序编写;</li>
      <li>400—599 表示政企合一单位的代码,应在本地区的范围内由小到大顺序编写。</li>
    </ol>
    <p>第³三段代码</p>
    <ol>
      <li>居民委员会的代码从001—199由小到大顺序编写;</li>
      <li>村民委员会的代码从200-399由小到大顺序编写。</li>
    </ol>
    <h2 id="参考链接"><a class="anchor" aria-hidden="true" tabindex="-1" href="#参考链接"><span class="octicon octicon-link"></span></a>参考链接</h2>
    <ul>
      <li><a href="http://www.stats.gov.cn/tjsj/tjbz/tjyqhdmhcxhfdm/">国家统计局 - 行政区划代码</a></li>
      <li><a href="http://www.mca.gov.cn/article/sj/xzqh">民政部 - 中华人民共和国行政区划代码</a></li>
      <li><a href="https://lbs.amap.com/api/webservice/guide/api/district">高德地图 - 行政区划</a></li>
      <li><a href="https://zh.wikipedia.org/wiki/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD%E8%A1%8C%E6%94%BF%E5%8C%BA%E5%88%92">维基百科 - 中华人民共和国行政区划</a></li>
      <li><a href="https://zh.wikipedia.org/wiki/%E4%B8%AD%E5%8D%8E%E4%BA%BA%E6%B0%91%E5%85%B1%E5%92%8C%E5%9B%BD%E8%A1%8C%E6%94%BF%E5%8C%BA%E5%88%92%E4%BB%A3%E7%A0%81">维基百科 - 中华人民共和国行政区划代码</a></li>
      <li><a href="http://www.mca.gov.cn/article/sj/xzqh/1980/201507/20150715854849.shtml">统计上使用的县以下行政区划代码编制规则</a></li>
      <li><a href="http://www.mca.gov.cn/article/sj/xzqh/1980/201507/20150715854848.shtml">民政统计代码编制规则</a></li>
      <li><a href="http://www.mohrss.gov.cn/SYrlzyhshbzb/zhuanti/jinbaogongcheng/Jbgcbiaozhunguifan/201112/t20111206_47429.html">国家和地区代码列表(下载)</a></li>
      <li><a href="http://www.gov.cn/gzdt/2010-01/15/content_1511043.htm">长途区号-行政区划对照表(修订稿),更新时间:2010-01-15</a></li>
    </ul>
    <h2 id="contributors"><a class="anchor" aria-hidden="true" tabindex="-1" href="#contributors"><span class="octicon octicon-link"></span></a>Contributors</h2><a href="https://github.com/uiwjs/province-city-china/graphs/contributors"><img src="https://uiwjs.github.io/province-city-china/CONTRIBUTORS.svg"></a>
    <h2 id="license"><a class="anchor" aria-hidden="true" tabindex="-1" href="#license"><span class="octicon octicon-link"></span></a>License</h2>
    <p><a href="./LICENSE">MIT</a></p>
  <style>markdown-style pre .copied {
  display: flex;
  position: absolute;
  cursor: pointer;
  color: #a5afbb;
  top: 6px;
  right: 6px;
  border-radius: 5px;
  background: #82828226;
  padding: 6px;
  font-size: 12px;
  transition: all .3s;
}
markdown-style pre .copied:not(.active) {
  visibility: hidden;
}
markdown-style pre:hover .copied {
  visibility: visible;
}
markdown-style pre:hover .copied:hover {
  background: #4caf50;
  color: #fff;
}
markdown-style pre:hover .copied:active,
markdown-style pre .copied.active {
  background: #2e9b33;
  color: #fff;
}
markdown-style pre .copied .octicon-copy {
  display: block;
}
markdown-style pre .copied .octicon-check {
  display: none;
}
markdown-style pre .active .octicon-copy {
  display: none;
}
markdown-style pre .active .octicon-check {
  display: block;
}</style><script>/*! @uiw/copy-to-clipboard v1.0.12 | MIT (c) 2021 Kenny Wang | https://github.com/uiwjs/copy-to-clipboard.git */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).copyTextToClipboard=t()}(this,(function(){"use strict";return function(e,t){const o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style={position:"absolute",left:"-9999px"},document.body.appendChild(o);const n=document.getSelection().rangeCount>0&&document.getSelection().getRangeAt(0);o.select();let c=!1;try{c=!!document.execCommand("copy")}catch(e){c=!1}document.body.removeChild(o),n&&document.getSelection&&(document.getSelection().removeAllRanges(),document.getSelection().addRange(n)),t&&t(c)}}));

function copied(target, str) {
  target.classList.add('active');
  copyTextToClipboard(target.dataset.code, function() {
    setTimeout(() => {
      target.classList.remove('active');
    }, 2000);
  });
}</script></markdown-style></body>
</html>