form表单提交的
<el-form-item label="试卷类型">
<!-- <el-input v-model="form.type"></el-input>-->
<input type="radio" id="male" value="0" v-model="form.type">练习试卷
<input type="radio" id="female" value="1" v-model="form.type">正式试卷
</el-form-item>
--------------------------------------------------
<el-table-column prop="type" label="试卷类型" width="120">
<template scope="scope">
<p v-if="scope.row.type=='0'">练习试卷</p>
<p v-if="scope.row.type=='1'">正式试卷</p>
</template>
</el-table-column>
----------------select框下拉选-------------------------------------------
一。 <el-form-item label="学院" prop="institute">
<el-select v-model="form.institute" clearable placeholder="学院" style="width:100%"
@change="onSelectedDrug($event)">
<el-option label="--请选择--" value=""></el-option>
<el-option v-for="item in majors" :key="item.collegeName" :label="item.collegeName"
:value="item.collegeName"/>
</el-select>
</el-form-item>
二。定义数组
data() {
return {
majors: {},
},
三。页面加载时放入数据和点击放入数据
created() {
this.getQueryCollege();
this.getExamInfo()
},
/*mounted() {
this.getCollege();
},*/
methods: {
getQueryCollege() {
this.$axios({
url: 'api/major/queryCollege',
})
//分页查询所有试卷信息 this.$axios(`/api/students/${this.pagination.current}/${this.pagination.size}/${this.query.studentName}`)
.then(res => {
this.majors = res.data.data
}).catch(error => {
});
},
vue 在列表中添加判断及select
最新推荐文章于 2023-10-19 13:50:01 发布