第一篇blog

Vue前后端分离项目实现交互的一个简单例子

作者:web小张 个人wechat:zhangzsun_ 一个奋进的前端工程师!!!

数据请求

mounted() {
this.getPageData(1);
},
methods: {
//表格数据
getPageData(id) {
var that = this;
this.$axios
.post("/Investmentapply/verifylists", { page: id, …that.selectData })
.then(res => {
if (res.data.code == 1) {
that.pagetotal = res.data.data.total;
console.log(“接受到了数据!!”);
console.log(res.data);
that.tableData6 = res.data.data.data;
that.clone6 = that.tableData6;
}
})
.catch(err => {
console.log(err);
});
},

接收数据

mounted() {
var that = this;
this.KaTeX parse error: Expected '}', got 'EOF' at end of input: …apply_id: this.route.query.apply_id
})
.then(res => {
if (res.data.code == 1) {
console.log(“123”);
console.log(res.data);
that.listBox = res.data.data;
if(res.data.data.invest_status==1){
that.pass=“审核通过”
}else{
that.pass=“审核不通过”
}
}
})
.catch(err => {
console.log(err);
});
},

数据渲染

  <el-table
    ref="multipleTable"
    :data="tableData6"
    tooltip-effect="dark"
    style="width: 100%"
    @selection-change="handleSelectionChange"
    size="mini"
  >
    <el-table-column type="selection" width="55"></el-table-column>
    <el-table-column prop="invest_name" label="公司全称" width="55"></el-table-column>
    <el-table-column prop="field_name" label="所属行业"></el-table-column>
    <el-table-column prop="stage_name" label="投资阶段"></el-table-column>
    <el-table-column prop="invest_realname" label="联系人姓名"></el-table-column>
    <el-table-column prop="invest_mobile" label="联系人手机号" show-overflow-tooltip></el-table-column>
    <el-table-column prop="invest_mobile" label="联系人微信号" show-overflow-tooltip></el-table-column>
    <el-table-column prop="invest_status" label="认证状态" show-overflow-tooltip>
      <template slot-scope="scope">
        <p v-if="scope.row.invest_status=1">审核成功</p>
      </template>
    </el-table-column>
    <el-table-column label="操作">
      <template slot-scope="scope">
        <el-button size="mini" type="text" @click="handleDelete(scope.$index, scope.row)">删除</el-button>
        <el-button size="mini" type="text" @click="handleDetails(scope.$index, scope.row)">查看详情</el-button>
      </template>
    </el-table-column>
  </el-table>

  <div class="page" v-if="pagetotal">
    <el-pagination
      layout="prev, pager, next"
      @current-change="handleCurrentChange"
      :total="pagetotal"
    ></el-pagination>
  </div>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值