写方法:请求后台
getList({ //后台方法名
uid_cid_tname_title: this.search,
page: this.currentPage,
size: this.pagesize //后台需要传的参数
}).then(res => {
console.log(res)
if (res.code !== 200) return this.$message.error('获取文件列表失败!')
else {
this.jobList.length = 0
this.$set(this, 'jobList', res.data.records)
// this.jobList = res.data.records
this.total = res.data.total //实现功能
}
})
el-select 实现下拉搜索
在el-select标签上面写这三行
ref=“select”
@hook:mounted=“xx”
@visible-change=“xx” //xx写上所需方法
mounted一进入页面立即请求的接口
删除一行remove(scope.row)需在使用此button外加一个<template slot-scope="scope"/>
iconfont为字体图标,使用为标签时没有颜色解决办法:添加一个style属性使color=需要的颜色即可
/* 多个card高度自适应 */
.el-row {
margin-bottom: 20px;
display: flex;
flex-wrap: wrap;
}
.el-row .el-card {
min-width: 100%;
height: 100%;
margin-right: 20px;
transition: all 0.5s;
}
:total 只能识别数字 不能识别字符串