前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >vue2.0 + element-ui 实战项目-渲染表格(四)

vue2.0 + element-ui 实战项目-渲染表格(四)

作者头像
王小婷
发布2020-11-03 10:23:55
6620
发布2020-11-03 10:23:55
举报
文章被收录于专栏:编程微刊编程微刊

Element UI手册:https://cloud.tencent.com/developer/doc/1270 github地址:https://github.com/ElemeFE/element

vue2.0官方网站:http://caibaojian.com/vue/guide/installation.html element-ui官方网站:https://element.eleme.cn/#/zh-CN


返回的json数据

代码语言:javascript
复制
[
    {
        "id": 45,
        "placeId": "12",
        "buildingId": 1254,
        "floorId": "1",
        "leftLowerLon": 23.98,
        "leftLowerLat": 12.23,
        "rightUpperLon": 45.55,
        "rightUpperLat": 34.67,
        "rotationAngle": 45.23,
        "scaling": 12.44
    },
    {
        "id": 46,
        "placeId": "",
        "buildingId": 0,
        "floorId": "",
        "leftLowerLon": 22.0,
        "leftLowerLat": 0.0,
        "rightUpperLon": 0.0,
        "rightUpperLat": 0.0,
        "rotationAngle": 0.0,
        "scaling": 0.0
    },
    {
        "id": 47,
        "placeId": "12",
        "buildingId": 234,
        "floorId": "12",
        "leftLowerLon": 34.0,
        "leftLowerLat": 23.0,
        "rightUpperLon": 23.0,
        "rightUpperLat": 34.0,
        "rotationAngle": 45.0,
        "scaling": 90.0
    }
]

代码

代码语言:javascript
复制
<template>
    <div id="app">
      <el-table :data="pvData" border fit highlight-current-row style="width: 100%;" class="tb-edit">
      <el-table-column label="场景ID" prop="placeId" width="180"></el-table-column>
      <el-table-column label="建筑物ID" prop="buildingId" width="110px" align="center"></el-table-column>
      <el-table-column label="楼层ID" prop="floorId" width="110px" align="center"></el-table-column>
      <el-table-column label="经度(左下)" prop="leftLowerLon" width="110px" align="center"></el-table-column>
      <el-table-column label="纬度(左下)" prop="leftLowerLat" width="110px" align="center"></el-table-column>
      <el-table-column label="经度(右上)" prop="rightUpperLon" width="110px" align="center"></el-table-column>
      <el-table-column label="纬度(右上)" prop="rightUpperLat" width="110px" align="center"></el-table-column>
     <el-table-column label="旋转角度" prop="rotationAngle" width="110px" align="center"></el-table-column>
     <el-table-column label="缩放比例" prop="scaling" width="110px" align="center"></el-table-column>
      <!-- <el-table-column label="操作" align="center" width="230" class-name="small-padding fixed-width">
        <template slot-scope="{ row, $index }">
          <el-button type="primary" size="mini" @click="handleUpdate(row)">编辑</el-button>
          <el-button
            v-if="row.status != 'deleted'"
            size="mini"
            type="danger"
            @click="handleDelete($index, row)"
          >删除</el-button>
        </template>
      </el-table-column> -->
    </el-table>
    
    </div>
</template>
<script>
    import axios from "axios";
    export default {
        name: "app",
        data() {
            return {              
                 pvData: [],
            }
        },
        mounted() {
            this.getData();
        },
        methods: {
            getData() {
                axios.get('/api/ConfigServer/picture.action').then(response => {
                    console.log(response.data);
                    this.pvData = response.data;
                }, response => {
                    console.log("error");
                });
            }
        }
    }
</script>

渲染效果如下

ok,既然表格渲染完成了,那么接下来就要做增删改查 了。

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档