<template>
<div>
<el-select v-model="editUserFormData.checkUserId"
placeholder="请选择审核人"
style="width: 100%">
<el-option v-for="item in selectData" :key="item.checkUserId" :label="item.username" :value="item.checkUserId">
</el-option>
</el-select>
</div>
</template>
<script>
export default {
name: 'editor',
data: function(){
return {
editUserFormData:
{
},
//审核人数据部分
checkUserId:'',
username:'',
//下拉数据
selectData: [/* {checkUserId:"", username:"ces"},*/],
}
},
created() {
this.getCheckUser();
},
methods: {
//获取所有审核人信息
getCheckUser(){
var that=this;
this.axios.get(`/checkTeacher/getCheckUser/`).then(function(resp){
if(resp.data.code===2000){
for(let item of resp.data.result) {
//console.log(item.username)
that.selectData.push({checkUserId:item.checkUserId,username:item.username})
}
}
});
},
}
}
</script>
<style scoped>
.editor-btn{
margin-top: 20px;
}
</style>
动态生成下拉选项框示例
最新推荐文章于 2024-08-18 12:24:07 发布