<template>
  <div>
    <a-cascader
      :value="$attrs.value ? $attrs.value.split(',') : []"
      :field-names="{ label: 'name', value: 'name', children: 'children' }"
      :options="areaData"
      :placeholder="placeholder"
      @change="onChange"
    />
  </div>
</template>

<script>
import components from './_import-components/xm-cascadeer-com-import'
import areaData from './component-library/areadata'
export default {
  name: 'XmCascadeerCom',
  metaInfo: {
    title: 'XmCascadeerCom',
  },
  components,
  data() {
    return {
      areaData,
      placeholder: '请选择地址',
      val: [],
    }
  },

  methods: {
    onChange(value) {
      this.$emit('input', value === null ? value : value.toString())
    },
  },
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
</style>
