• 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>

    实现思路

  • 相关阅读:
    1 let和const
    ECMAScript 6 扫盲
    回溯法
    13. Ajax技术
    12.JSTL标签
    11.EL(表达式语言)
    10.正则表达式(未完成)
    博客园自定义样式
    9.一次简单的Web作业
    8.JavaScript
  • 原文地址:https://www.cnblogs.com/yugueilou/p/15016719.html
Copyright © 2020-2023  润新知