Vue学习1
1
<el-form-item label="项目状态" align="center">
<template slot-scope="scope">
<el-switch v-model="form.runStatus" :active-value="1" :inactive-value="0" ></el-switch>
</template>
</el-form-item>
小心
:active-value="1" :inactive-value="0" 要加冒号,让它不要是字符串
下拉列表
<el-form-item label="项目状态" prop="runStatus">
<el-select v-model="queryParams.runStatus" placeholder="请选择项目状态" clearable size="small" style="width: 240px">
<el-option v-for="statusName in statusOptions" :key="statusName" :label="statusName.label" :value="statusName.value" />
</el-select>
</el-form-item>
其中 statusOptions 相等于queryParams.runStatus
<el-table-column label="项目类别" align="center" prop="category" >
<template slot-scope="scope">
<span>{{ getCategory(scope.row.category) }}</span>
</template>
</el-table-column>
弹出确认提示
this.$confirm('是否确认导出所有所选数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportKjobtimeVo(queryParams);
}).then(response => {
this.download(response.msg);
}).catch(function () {
});
}