<template>
    <div>
        <el-cascader
            v-model="newForm[item.english]"
            :options="selectData"
        >
        </el-cascader>
        <!-- <el-select v-model="newForm[item.english]" :placeholder="item.placeholder" :disabled="!item.enabled">
          <el-option v-for="(options,index) in selectData" :key="index" :label="options.label" :value="options.value" />
        </el-select> -->
        <div v-if="newForm[item.explain]">{{ newForm[item.explain] }}</div>    
    </div>
</template>

<script>

import { createDb } from '../utils/CommonRequest'

const $metiiAPI = createDb();

export default {
    data(){
        return {
            selectData:[]
        }
    },
    props:{
        newForm: Object,
        item: Object
    }, 
    mounted() {
        this.getSelectData(this.item.sourcedata)
    },
    methods:{
        async getSelectData(url){
            this.selectData = await $metiiAPI.getFormtData(this.item.sourcedata);
        },
    }
}
</script>

<style lang="scss" scoped>

</style>