Files
shangfutong-ui/jeepay-ui-manager/src/components/JeepayUIComponents/JeepayAreaSelect/JeepayAreaNameSelectUmhs.vue
2024-05-23 14:39:33 +08:00

35 lines
945 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--
省市县三级联动选择 国标 返回省市区名称
直辖市第一级不包含比如北京 北京市 某某区
@author terrfly
@site https://www.jeequan.com
@date 2022/01/17 19:34
-->
<template>
<a-cascader
:field-names="{ label: 'label', value: 'label', children: 'children' }"
:value="props.value"
:options="allList"
placeholder="选择省市县"
@change="changeFunc"
/>
</template>
<script lang="ts" setup>
import { defineProps } from 'vue'
import allList from './areacodeUmhs.json'
const props = defineProps({
value: { type: Array, default: null },
})
// emit 父组件使用: v-model="val" 进行双向绑定。
const emit = defineEmits(['update:value'])
// 当属性发生了变化, 需要通过函数向父组件通信 --》 父组件再通知子组件进行数据的变化。
function changeFunc(value){
emit('update:value', value)
}
</script>