<template>
    <mx-form-item v-if="disabled" v-model="model[propProvince]" :prop="propProvince" :label="labelProvince" disabled/>
    <mx-form-item v-else :prop="propProvince" :label="labelProvince">
        <mx-picker v-model="model[propProvince]" placeholder="请选择省份" :data="provinceOptions"/>
    </mx-form-item>
</template>

<script setup>
import {createPropDefine} from "@/utils";
import {useInjectFormData} from "@/pages/login/components/hooks/useFormDataInjection";
import {useInjectProvince} from "@/pages/login/components/hooks/useProvinceInjection";

defineProps({
    propProvince: createPropDefine('provinceName'),
    labelProvince: createPropDefine('所在省份'),
    disabled: createPropDefine(false, Boolean)
})

const [model] = useInjectFormData()
const {provinceOptions} = useInjectProvince({provinceOptions: []})
</script>

<style scoped>

</style>