git地址:https://github.com/ht-sauce/elui-china-area-dht 使用:npm i elui-china-area-dht 默认使用
使用方法
代码语言:javascript复制<template>
<div class="app">
<!--默认使用-->
<elui-china-area-dht @change="onChange"></elui-china-area-dht>
<!--带isall参数和leave参数示例-->
<elui-china-area-dht isall :leave="2" @change="onChange"></elui-china-area-dht>
</div>
</template>
<script>
import { defineComponent } from 'vue'
import { EluiChinaAreaDht } from 'elui-china-area-dht'
const chinaData = new EluiChinaAreaDht.ChinaArea().chinaAreaflat
export default defineComponent({
components: {
EluiChinaAreaDht,
},
setup() {
function onChange(e) {
const one = chinaData[e[0]]
const two = chinaData[e[1]]
console.log(one, two)
}
return {
onChange,
}
},
})
</script>