by @leisure Skip to content

area

省市区县乡镇街道

  • 提供在线和本地JSON获取数据2种方式
  • 双向数据绑定,级联选择国内所有省市区县乡镇街道

基础用法

可以传入v-model值回显

110107
<template>
  <div class="content-wrap">
    <adv-area v-model="areaVal"></adv-area> {{ areaVal }}
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const areaVal = ref("110107");
</script>

<style scoped></style>

会调用接口实时懒加载数据,数据可以精确到街道乡镇

<template>
  <div class="content-wrap">
    <adv-area remote v-model="areaVal"></adv-area> {{ areaVal }}
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";

const areaVal = ref();
</script>

<style scoped></style>

模型接口

ts
interface PropI {
  modelValue?: string | (string | number)[];
  placeholder?: string;
  emitPath?: boolean;
}

属性

属性是否必填默认值说明
v-modelstring | (string | number)[]default双向绑定值
placeholderstring请选择原生placeholder
emitPathBooleanfalsemodel是否展示全路径

插槽

插槽名是否必填默认值说明

鄂ICP备2024065629号-1     📮联系邮箱:570337910@qq.com