欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

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

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

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="標(biāo)題1"
        prop="name1"
        align="left">
        <template slot-scope="scope">
          <span>{{ scope.row.name1}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數(shù)據(jù)1"
        prop="value1"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標(biāo)4'">
            <quartileChart :quartile="scope.row.value1"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value1}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數(shù)據(jù)2"
        prop="value2"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標(biāo)4'">
            <quartileChart :quartile="scope.row.value2"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value2}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數(shù)據(jù)3"
        prop="value3"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標(biāo)4'">
            <quartileChart :quartile="scope.row.value3"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value3}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數(shù)據(jù)4"
        prop="value4"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標(biāo)4'">
            <quartileChart :quartile="scope.row.value4"></quartileChart>
          </div>
          <span v-else>{{ scope.row.value4}}</span>
        </template>
      </el-table-column>
      <el-table-column
        label="數(shù)據(jù)5"
        prop="value5"
        align="center">
        <template slot-scope="scope">
          <div v-if="scope.row.name1 === '指標(biāo)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: '指標(biāo)1',
          value1: '0.33%', 
          value2: '0.33%', 
          value3: '0.33%', 
          value4: '0.33%', 
          value5: '0.33%', 
        },
        {
          name1: '指標(biāo)2',
          value1: '0.33%', 
          value2: '0.33%', 
          value3: '0.33%', 
          value4: '0.33%', 
          value5: '0.33%', 
        },
        {
          name1: '指標(biāo)3',
          value1: '0.33%', 
          value2: '0.33%', 
          value3: '0.33%', 
          value4: '0.33%', 
          value5: '0.33%', 
        },
        {
          name1: '指標(biāo)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>

展示效果圖:

在這里插入圖片描述

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

相關(guān)文章

  • vue-router路由懶加載及實(shí)現(xiàn)方式

    vue-router路由懶加載及實(shí)現(xiàn)方式

    這篇文章主要介紹了vue-router路由懶加載及實(shí)現(xiàn)方式,路由懶加載的主要作用是將 路由對(duì)應(yīng)的組件打包成一個(gè)個(gè)的js代碼塊,只有在這個(gè)路由被訪問(wèn)到的時(shí)候,才會(huì)加載對(duì)應(yīng)組件的代碼塊,需要的朋友可以參考下
    2022-12-12
  • Vue三種常用傳值示例(父?jìng)髯印⒆觽鞲?、非父?

    Vue三種常用傳值示例(父?jìng)髯?、子傳父、非父?

    這篇文章主要介紹了Vue傳值-三種常用傳值示例,主要介紹了父組件向子組件進(jìn)行傳值,子組件向父組件傳值和非父子組件進(jìn)行傳值,感興趣的小伙伴們可以參考一下
    2018-07-07
  • 基于Vue2實(shí)現(xiàn)動(dòng)態(tài)折扣表格

    基于Vue2實(shí)現(xiàn)動(dòng)態(tài)折扣表格

    這篇文章主要為大家詳細(xì)介紹了如何基于Vue2實(shí)現(xiàn)動(dòng)態(tài)折扣表格,文中的示例代碼講解詳細(xì),具有一定的借鑒價(jià)值,感興趣的小伙伴可以跟隨小編一起學(xué)習(xí)一下
    2024-01-01
  • vue3中的ref與reactive使用方法對(duì)比

    vue3中的ref與reactive使用方法對(duì)比

    Vue3 提供了兩個(gè)新的 API:ref 和 reactive,它們可以幫助我們更好地管理和處理響應(yīng)式數(shù)據(jù),這篇文章主要介紹了vue3中的ref與reactive的區(qū)別和使用方法,需要的朋友可以參考下
    2023-04-04
  • 如何在Vue3中使用Ref訪問(wèn)DOM元素詳解

    如何在Vue3中使用Ref訪問(wèn)DOM元素詳解

    在Vue3中可以使用`ref`來(lái)獲取DOM元素,下面這篇文章主要給大家介紹了關(guān)于如何在Vue3中使用Ref訪問(wèn)DOM元素的相關(guān)資料,文中通過(guò)代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2024-09-09
  • vue在標(biāo)簽中如何使用(data-XXX)自定義屬性并獲取

    vue在標(biāo)簽中如何使用(data-XXX)自定義屬性并獲取

    這篇文章主要介紹了vue在標(biāo)簽中如何使用(data-XXX)自定義屬性并獲取,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-08-08
  • VUE中操作dom元素的幾種方法(最新推薦)

    VUE中操作dom元素的幾種方法(最新推薦)

    本文給大家總結(jié)了Vue中操作dom元素的多種方法,每種方法結(jié)合實(shí)例代碼給大家講解的非常詳細(xì),需要的朋友參考下吧
    2022-12-12
  • vue編譯打包本地查看index文件的方法

    vue編譯打包本地查看index文件的方法

    下面小編就為大家分享一篇vue編譯打包本地查看index文件的方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-02-02
  • mpvue項(xiàng)目中使用第三方UI組件庫(kù)的方法

    mpvue項(xiàng)目中使用第三方UI組件庫(kù)的方法

    這篇文章主要介紹了mpvue項(xiàng)目中使用第三方UI組件庫(kù)的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-09-09
  • 詳解使用Vue.Js結(jié)合Jquery Ajax加載數(shù)據(jù)的兩種方式

    詳解使用Vue.Js結(jié)合Jquery Ajax加載數(shù)據(jù)的兩種方式

    本篇文章主要介紹了詳解使用Vue.Js結(jié)合Jquery Ajax加載數(shù)據(jù)的兩種方式,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2017-01-01

最新評(píng)論