<template>
    <div class="organization-cascader">
        <el-cascader
            ref='cascader'
            style="width: 100%"
            :show-all-levels='false'
            :options="options"
            :props="props"
            v-bind="$attrs"
            v-on="$listeners"
        ></el-cascader>
    </div>
</template>

<script>
import { deptTree } from '@/api/admin/dept'

export default {
    data() {
        return {
            options: [],
            props: {
                value: 'code',
                label: 'name',
                checkStrictly: true,
                emitPath: false
            }
        }
    },
    created() {
        deptTree().then(res => {
            this.options = res.data
        })
    }
}
</script>
