ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<script lang="ts" setup>
defineOptions({ inheritAttrs: false });
const props = defineProps(['activeData']);
 
const levelOptions = [
  { id: 0, fullName: '省' },
  { id: 1, fullName: '省市' },
  { id: 2, fullName: '省市区' },
  { id: 3, fullName: '省市区-街道' },
];
 
function onChange() {
  props.activeData.__config__.defaultValue = [];
  props.activeData.__config__.renderKey = Date.now();
}
</script>
<template>
  <a-form-item label="默认值">
    <jnpf-area-select
      v-model:value="activeData.__config__.defaultValue"
      placeholder="选择默认值"
      :multiple="activeData.multiple"
      :level="activeData.level"
      allow-clear
      :key="activeData.__config__.renderKey" />
  </a-form-item>
  <a-form-item label="格式">
    <jnpf-radio v-model:value="activeData.level" :options="levelOptions" class="level-radio" @change="onChange" />
  </a-form-item>
  <a-form-item label="能否清空">
    <a-switch v-model:checked="activeData.clearable" />
  </a-form-item>
  <a-form-item label="能否多选">
    <a-switch v-model:checked="activeData.multiple" @change="onChange" />
  </a-form-item>
</template>
<style lang="scss" scoped>
.level-radio {
  :deep(.ant-radio-wrapper) {
    display: block;
  }
}
</style>