vue 動態表頭,動態數據,可編輯


<el-table
              :data="tableData"
              border
              class="tb-edit"
              style="width: 100%"
              highlight-current-row
              @row-click="handleCurrentChange"
            >
              <el-table-column
                align="center"
                width="180"
                :label="item.type_name"
                :prop="item.id"
                v-for="(item, index) in attr"
                :key="index"
              >
                <template slot="header" slot-scope="scope">
                  <el-input
                    size="small"
                    v-if="scope"
                    v-model="item.attr_value"
                    :placeholder="'請輸入' + item.type_name"
                    @input="bigInput(item)"
                  ></el-input>
                </template>
                <el-table-column
                  :prop="item.id"
                  :label="item.type_name"
                  width="180"
                  align="center"
                >
                  <template scope="scope">
                    <el-input
                      size="small"
                      v-model="scope.row[attr[index].type_name + '_value']"
                      :placeholder="'請輸入' + item.type_name"
                      @change="handleEdit(scope.$index, scope.row)"
                    ></el-input>
                  </template>
                </el-table-column>
              </el-table-column>
            </el-table>
 

 

 

 

 

 

 

 

 

 

 

 

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM