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


    <template>
      <div>
          <el-dialog
          width="60%"
          title="任务详情"
          :visible.sync="innerVisible"
          append-to-body>
    
        <el-table
          :data="$store.state.taskData"
    
          border
          style=" 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>

    实现思路

  • 相关阅读:
    获取指定字符传的长度或者高度
    检测身份证号码是否合法
    tabbar添加小红点
    单例的简单构造
    iOS程序内发短信
    多项式加法运算 使用链表实现
    链表的数组实现
    使用链表实现堆栈
    使用链表实现堆栈
    求最大子列和的几种方法
  • 原文地址:https://www.cnblogs.com/yugueilou/p/15016719.html
Copyright © 2020-2023  润新知