最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue elementui el-table 表格里邊展示四分位圖效果(功能實現)

 更新時間:2024年04月27日 11:32:47   作者:鹽多碧咸。。  
這篇文章主要介紹了vue elementui el-table 表格里邊展示四分位圖效果(功能實現),本文通過示例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友參考下吧

vue elementui el-table 表格里邊展示四分位圖

直接上代碼(效果圖在文章末尾):

父組件:

<template>
<el-table 
      size="small"
      :header-cell-style="headerCellStyle()"
      style="width: 100%;"
      highlight-current-row
      row-key="index"
      :data="tableData1" 
      >
      <el-table-column
        label="標題1"
        prop="name1"
        align="left">
        <template slot-scope="scope">
          <span>{{ scope.row.name1}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數據1"
        prop="value1"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標4'">
            <quartileChart :quartile="scope.row.value1"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value1}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數據2"
        prop="value2"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標4'">
            <quartileChart :quartile="scope.row.value2"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value2}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數據3"
        prop="value3"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標4'">
            <quartileChart :quartile="scope.row.value3"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value3}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數據4"
        prop="value4"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標4'">
            <quartileChart :quartile="scope.row.value4"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value4}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數據5"
        prop="value5"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標4'">
            <quartileChart :quartile="scope.row.value5"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value5}}</span>
        </template>
      </el-table-column>
    </el-table>
</template>
<script>
import quartileChart from '@/components/quartileChart.vue' // 引入子組件(四分位圖),注意引入路徑
export default {
components: { quartileChart },
  data() {
    return {
    	tableData1: [
        {
          name1: '指標1',
          value1: '0.33%', 
          value2: '0.33%', 
          value3: '0.33%', 
          value4: '0.33%', 
          value5: '0.33%', 
        },
        {
          name1: '指標2',
          value1: '0.33%', 
          value2: '0.33%', 
          value3: '0.33%', 
          value4: '0.33%', 
          value5: '0.33%', 
        },
        {
          name1: '指標3',
          value1: '0.33%', 
          value2: '0.33%', 
          value3: '0.33%', 
          value4: '0.33%', 
          value5: '0.33%', 
        },
        {
          name1: '指標4',
          value1: '1', 
          value2: '2', 
          value3: '3', 
          value4: '4', 
          value5: null, 
        }
      ]
    },
    methods: {
      headerCellStyle () {
       return {
        color: " #333 !important", 
        backgroundColor: "#cedff3  !important",
        fontSize: '14px',
        fontWeight: 500,
       }
      },
    }
  }
}
</script>

子組件:

<template>
  <div>
    <div v-if="5 - Number(quartile) === 1" class="ranking rank_1">
      <div class="r4"></div>
      <div class="r3"></div>
      <div class="r2"></div>
      <div class="r1"></div>
    </div>
    <div v-else-if="5 - Number(quartile) === 2" class="ranking rank_2">
      <div class="r4"></div>
      <div class="r3"></div>
      <div class="r2"></div>
      <div class="r1"></div>
    </div>
    <div v-else-if="5 - Number(quartile) === 3" class="ranking rank_3">
      <div class="r4"></div>
      <div class="r3"></div>
      <div class="r2"></div>
      <div class="r1"></div>
    </div>
    <div v-else-if="5 - Number(quartile) === 4" class="ranking rank_4">
      <div class="r4"></div>
      <div class="r3"></div>
      <div class="r2"></div>
      <div class="r1"></div>
    </div>
    <div v-else class="ranking rank_5">
      <div class="r4"></div>
      <div class="r3"></div>
      <div class="r2"></div>
      <div class="r1"></div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'quartileChart',
  components: {},
  props: {
    quartile: {
      type: String,
    }
  },
  data () {
    return {
    }
  },
  created () {},
  mounted () {},
  computed: {},
  watch: {},
  methods: {},
}
</script>
<style lang="scss" scoped>
.ranking{
  width: 47px;
  margin: 0 auto;
  height: 39px;
  margin-top: 1px;
  margin-bottom: 2px;
  div {
    height: 9px;
    zoom: 1;
    overflow: hidden;
    border: 1px solid #dcdcdc;
    margin-top: -1px;
  }
}
.rank_1 { 
  .r4 {
    height: 11px;
  }
  .r3 {
    height: 11px;
  }
  .r2 {
    height: 11px;
  }
  .r1 {
    border: 0;
    background: #e1edfc;
    height: 11px;
  }
}
.rank_2 { 
  .r4 {
    height: 11px;
  }
  .r3 {
    height: 11px;
  }
  .r2 {
    border: 0;
    background: #cbdff8;
    height: 11px;
  }
  .r1 {
    border: 0;
    background: #e1edfc;
    height: 11px;
  }
}
.rank_3 { 
  .r4 {
    height: 11px;
  }
  .r3 {
    border: 0;
    background: #b3ceef;
    height: 11px;
  }
  .r2 {
    border: 0;
    background: #cbdff8;
    height: 11px;
  }
  .r1 {
    border: 0;
    background: #e1edfc;
    height: 11px;
  }
}
.rank_4 { 
  .r4 {
    border: 0;
    background: #94b7e3;
    height: 11px;
  }
  .r3 {
    border: 0;
    background: #b3ceef;
    height: 11px;
  }
  .r2 {
    border: 0;
    background: #cbdff8;
    height: 11px;
  }
  .r1 {
    border: 0;
    background: #e1edfc;
    height: 11px;
  }
}
.rank_5 { 
  .r4 {
    height: 11px;
  }
  .r3 {
    height: 11px;
  }
  .r2 {
    height: 11px;
  }
  .r1 {
    height: 11px;
  }
}
</style>

展示效果圖:

在這里插入圖片描述

到此這篇關于vue elementui el-table 表格里邊展示四分位圖的文章就介紹到這了,更多相關vue elementui el-table 四分位圖內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!

相關文章

  • vue項目使用可選鏈操作符編譯報錯問題及解決

    vue項目使用可選鏈操作符編譯報錯問題及解決

    這篇文章主要介紹了vue項目使用可選鏈操作符編譯報錯問題及解決方案,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-03-03
  • Vue前端判斷數據對象是否為空的實例

    Vue前端判斷數據對象是否為空的實例

    這篇文章主要介紹了Vue前端判斷數據對象是否為空的實例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-09-09
  • 解決VUE打包后與nginx代理出現加載速度超級慢的問題

    解決VUE打包后與nginx代理出現加載速度超級慢的問題

    這篇文章主要介紹了解決VUE打包后與nginx代理出現加載速度超級慢的問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2023-09-09
  • 詳解基于vue的服務端渲染框架NUXT

    詳解基于vue的服務端渲染框架NUXT

    這篇文章主要介紹了Nuxt之vue服務端渲染,NUXT集成了利用Vue開發(fā)服務端渲染的應用所需要的各種配置,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2018-06-06
  • Vue將頁面導出為圖片或者PDF

    Vue將頁面導出為圖片或者PDF

    這篇文章主要為大家詳細介紹了Vue導出頁面為PDF格式,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2019-06-06
  • vuex中使用modules時遇到的坑及問題

    vuex中使用modules時遇到的坑及問題

    這篇文章主要介紹了vuex中使用modules時遇到的坑及問題,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教
    2022-08-08
  • vue如何自動化打包測試環(huán)境和正式環(huán)境的dist/test文件

    vue如何自動化打包測試環(huán)境和正式環(huán)境的dist/test文件

    這篇文章主要介紹了vue如何自動化打包測試環(huán)境和正式環(huán)境的dist/test文件,小編覺得挺不錯的,現在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2019-06-06
  • 淺析Vue項目中使用keep-Alive步驟

    淺析Vue項目中使用keep-Alive步驟

    這篇文章簡單給大家介紹了Vue項目中使用keep-Alive步驟,在vue2.1.0之前,實現方式也給大家作了簡單介紹,感興趣的朋友跟隨腳本之家小編一起看看吧
    2018-07-07
  • Vue實現各種類型文件的預覽功能

    Vue實現各種類型文件的預覽功能

    這篇文章主要介紹了如何在Vue3中使用aceEditor插件和vue-ipynb插件實現不同類型的文件預覽,包括txt、md、json、pkl、mps、py、ipynb、doc、docx、pdf、xlsx、csv等文件,需要的朋友可以參考下
    2025-03-03
  • vue el-table字段點擊出現el-input輸入框,失焦保存方式

    vue el-table字段點擊出現el-input輸入框,失焦保存方式

    這篇文章主要介紹了vue el-table字段點擊出現el-input輸入框,失焦保存方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-02-02

最新評論

密云县| 京山县| 肃北| 宜君县| 富阳市| 达尔| 曲松县| 瑞丽市| 彭泽县| 神池县| 荣昌县| 吉安市| 乐都县| 南平市| 贵德县| 铅山县| 博罗县| 阿拉尔市| 怀安县| 喀什市| 清水河县| 旌德县| 青岛市| 砀山县| 新密市| 永顺县| 资兴市| 莱西市| 东明县| 南安市| 准格尔旗| 庆安县| 太湖县| 长治市| 图木舒克市| 娄烦县| 美姑县| 萍乡市| 香港 | 栾川县| 临澧县|