欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

怎么在vue中使用el-table自定義表頭

怎么在vue中使用el-table自定義表頭?針對這個問題,這篇文章詳細(xì)介紹了相對應(yīng)的分析和解答,希望可以幫助更多想解決這個問題的小伙伴找到更簡單易行的方法。

創(chuàng)新互聯(lián)堅持“要么做到,要么別承諾”的工作理念,服務(wù)領(lǐng)域包括:成都網(wǎng)站設(shè)計、網(wǎng)站制作、外貿(mào)營銷網(wǎng)站建設(shè)、企業(yè)官網(wǎng)、英文網(wǎng)站、手機端網(wǎng)站、網(wǎng)站推廣等服務(wù),滿足客戶于互聯(lián)網(wǎng)時代的烏爾禾網(wǎng)站設(shè)計、移動媒體設(shè)計的需求,幫助企業(yè)找到有效的互聯(lián)網(wǎng)解決方案。努力成為您成熟可靠的網(wǎng)絡(luò)建設(shè)合作伙伴!

el-table可以通過設(shè)置 Scoped slot 來實現(xiàn)自定義表頭。

文檔說明如下:

怎么在vue中使用el-table自定義表頭

代碼實現(xiàn):

<template>
 <el-dialog
  width="50%"
  :visible.sync="isShow"
  :before-close="beforeClose"
  title="自定義設(shè)備類型屬性">
  <div class="dialogDiv">
   <el-table 
    :data="tableData.filter(data => handleAdd || data.name.toLowerCase().includes(handleAdd.toLowerCase()))" 
     border>
    <el-table-column prop="code" 
     :label="$t('basicData.device.propDlg.code')">
    </el-table-column>
    <el-table-column prop="maxValue" 
     :label="$t('basicData.device.propDlg.maxValue')">
    </el-table-column>
    <el-table-column prop="minValue" 
     :label="$t('basicData.device.propDlg.minValue')">
    </el-table-column>
    <el-table-column prop="name" 
     :label="$t('basicData.device.propDlg.name')">
    </el-table-column>
    <el-table-column prop="valueType" 
     :label="$t('basicData.device.propDlg.valueType')">
    </el-table-column>
    <el-table-column prop="warning" 
     :label="$t('basicData.device.propDlg.warning')">
    </el-table-column>
    <el-table-column align="center" width="160px">
     <template slot="header" slot-scope="scope">
      <el-button v-model="handleAdd" 
       size="mini"
       type="success"
       circle plain
       icon="el-icon-plus"
       @click="handleAdd(scope.$index, scope.row)">      
      </el-button>
     </template>
     <template slot-scope="scope">
      <el-button
       size="mini"
       type="primary"
       circle plain
       icon="el-icon-edit"
       @click="handleEdit(scope.$index, scope.row)">
      </el-button>
      <el-button
       size="mini"
       type="danger"
       circle plain
       icon="el-icon-delete"
       @click="handleDelete(scope.$index, scope.row)">
      </el-button>
     </template>
    </el-table-column>
   </el-table>
  </div>
  <span slot="footer">
   <el-button @click="cancel">{{ $t('common.cancel') }}</el-button>
   <el-button @click="confirm" type="primary">{{ $t('common.confirm') }}</el-button>
  </span>
 </el-dialog>
</template>

<script>
export default {
 data() {
  return {
   tableData: []
  }
 },
 methods: {
  // 添加
  handleAdd() {
  },
  // 編輯
  handleEdit(index, row) {  
  },
  // 刪除
  handleDelete(index, row) {
  },
  cancel() {
   this.$emit("cancel")
  },
  confirm() {
   this.$emit("confirm", this.tableData)
  }
 }
};
</script>

<style lang="scss" scoped>
.dialogDiv {
 height: 300px;
 overflow: auto;
}
</style>

頁面效果如下:

怎么在vue中使用el-table自定義表頭

關(guān)于怎么在vue中使用el-table自定義表頭問題的解答就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,如果你還有很多疑惑沒有解開,可以關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道了解更多相關(guān)知識。

網(wǎng)站題目:怎么在vue中使用el-table自定義表頭
鏈接URL:http://www.chinadenli.net/article42/gisghc.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供全網(wǎng)營銷推廣用戶體驗微信小程序網(wǎng)站收錄服務(wù)器托管品牌網(wǎng)站制作

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

手機網(wǎng)站建設(shè)