首页 > 其他 > 详细

vue实现表格自建与表格内容填写

时间:2021-07-15 18:57:02      阅读:23      评论:0      收藏:0      [点我收藏+]
<template>
  <div>
      <el-dialog
      width="60%"
      title="任务详情"
      :visible.sync="innerVisible"
      append-to-body>

    <el-table
      :data="$store.state.taskData"

      border
      style="width: 100%; margin-top: 20px">
      <el-table-column
        prop="parent"
        label="业务领域"
        width="180">
      </el-table-column>
      <el-table-column
        prop="taskName"
        label="任务名称">
      </el-table-column>
      <el-table-column
        prop="amount"
        label="人员">
      </el-table-column>

    </el-table>
       <span slot="footer" class="dialog-footer">
    <el-button @click="cancel">取 消</el-button>
    <el-button type="primary" @click="saveTask">确 定</el-button>
  </span>
    </el-dialog>

  </div>
</template>

<script>
export default {
  props:{
    person:String,
    taskData:Array
  },

methods: {
  saveTask(){
    this.innerVisible=false
    this.$emit(savetask)
  },
  cancel(){
    this.innerVisible=false

  },
       objectSpanMethod({ row, column, rowIndex, columnIndex }) {
        if (columnIndex === 0) {
          if (rowIndex % 2 === 0) {
            return {
              rowspan: 2,
              colspan: 1
            };
          } else {
            return {
              rowspan: 0,
              colspan: 0
            };
          }
        }
      }

},
  data(){
    return {
      innerVisible:false,
      taskData:[],
       tableData: []
    }
  },
  mounted(){



  }

}
</script>

<style>

</style>

实现思路

技术分享图片

 

vue实现表格自建与表格内容填写

原文:https://www.cnblogs.com/yugueilou/p/15016719.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!