mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 14:26:45 +08:00
45 lines
856 B
Vue
45 lines
856 B
Vue
<template>
|
|
<a-select
|
|
v-model:value="id"
|
|
:options="options"
|
|
style="width: 100%"
|
|
placeholder="请选择分类"
|
|
:disabled="disabled"
|
|
/>
|
|
</template>
|
|
<script>
|
|
import {onMounted, reactive, toRefs, watch} from "vue";
|
|
import {useStore} from "vuex";
|
|
|
|
export default {
|
|
name: "TrainClass",
|
|
|
|
props: {
|
|
modelValue: {
|
|
type: Number,
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false
|
|
},
|
|
},
|
|
setup(props, ctx) {
|
|
const store = useStore();
|
|
|
|
const state = reactive({
|
|
options: [],
|
|
id: props.modelValue
|
|
});
|
|
watch(state.id, () => {
|
|
ctx.emit('update:modelValue', state.id)
|
|
})
|
|
onMounted(() => {
|
|
state.options = store.state.projectSys.map(e => ({value: parseInt(e.dictCode), label: e.dictName}))
|
|
})
|
|
return {
|
|
...toRefs(state),
|
|
};
|
|
},
|
|
};
|
|
</script>
|