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

Vue 使用html、css實(shí)現(xiàn)魚骨組件圖

 更新時(shí)間:2024年07月05日 14:46:01   作者:Lucky_Turtle  
這篇文章主要介紹了Vue 使用html、css實(shí)現(xiàn)魚骨組件圖,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧

預(yù)覽圖

在這里插入圖片描述

組件

<template>
  <div class="context">
    <div class="top">
      <div class="label-context">
        <div class="label" v-for="(item, index) in value" :key="index">
          <div class="label-text" v-if="index % 2 === 0">
            {{ item.label }}
          </div>
          <div class="connect-line-box" v-if="index % 2 === 0">
            <div class="connect-line"><i class="center-line-icon"></i></div>
          </div>
        </div>
      </div>
    </div>
    <div class="center-line">
      <div class="icon-box" v-for="(item, index) in value" :key="index">
        <i class="center-line-icon"></i>
      </div>
    </div>
    <div class="bottom">
      <div class="label-context">
        <div class="label" v-for="(item, index) in value" :key="index">
          <div class="connect-line-box" v-if="index % 2 === 1">
            <div class="connect-line"></div>
          </div>
          <div class="label-text" v-if="index % 2 === 1">
            {{ item.label }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'FishBoneComponent',
  props: {
    value: {
      type: Array,
      default: () => [
        {
          time: '2024-06-13 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
        {
          time: '2024-06-12 15:27:30',
          label: ''
        },
      ]
    }
  },
  mounted() {
    this.value = this.value.sort((a, b) => {
      return new Date(a.time) - new Date(b.time);
    });
    console.log(this.value)
  }
}
</script>
<style lang="scss" scoped>
$center-color: #1890ff;
$text-box-width: 200px;
$text-margin-left: 10px;
$line-height: 40px;
$add-width: 0px;
$line-icon-size: 13px;
.context {
  width: 100%;
  padding: 0.5%;
  height: 100%;
}
.center-line {
  position: absolute;
  height: 2px;
  background-color: $center-color;
  width: 98%;
  display: flex;
  align-items: center;
  justify-content: left;
}
.center-line::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -10px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 10px solid $center-color;
  transform: translateY(-50%);
}
.center-line .icon-box:first-child {
  margin-left: $text-margin-left;
  width: $text-box-width/2 + $line-icon-size/2;
  flex-shrink: 0;
  i {
    float: right;
    width: $line-icon-size;
    height: $line-icon-size;
    flex-shrink: 0;
  }
}
.center-line .icon-box:not(:first-child) {
  margin-left: $text-margin-left - $line-icon-size/2;
  width: $text-box-width/2 + $line-icon-size/2;
  flex-shrink: 0;
  i {
    float: right;
    width: $line-icon-size;
    height: $line-icon-size;
    flex-shrink: 0;
  }
}
.center-line-icon {
  width: $line-icon-size;
  height: $line-icon-size;
  background-color: $center-color;
  border-radius: 50%;
}
.top .label-context {
  display: flex;
  flex-direction: row;
  justify-content: normal;
}
.connect-line-box {
  display: flex;
  flex-direction: row;
  text-align: center;
  justify-content: center;
}
.connect-line {
  width: 2px;
  height: $line-height;
  background-color: #1d71fa;
}
.top .label {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-left: $text-margin-left;
}
.label > div {
  width: $text-box-width;
  margin-left: $add-width;
  white-space: normal;
}
.bottom .label-context {
  display: flex;
  flex-direction: row;
  justify-content: normal;
  margin-left: $text-box-width/2;
}
.bottom .label {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin-left: $text-margin-left;
}
.label-text {
  padding: 6px;
  background-color: rgb($center-color, 0.08);
  border-radius: 3px;
  color: black;
  font-size: 15px;
}
</style>

測(cè)試案例

<template>
  <div class="card">
    <FishBoneComponent :value="data"></FishBoneComponent>
  </div>
</template>
<script>
import FishBoneComponent from "@/views/FishBoneComponent";
export default {
  name: "FishBone",
  components: {FishBoneComponent},
  data(){
    return{
      data: [
        {
          time: '2024-06-13 15:27:30',
          label: '測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試'
        },
        {
          time: '2024-06-12 15:27:30',
          label: '測(cè)試'
        },
      ]
    }
  }
}
</script>
<style scoped>
.card{
  padding: 8px;
}
.title-box{
  margin-bottom: 8px;
}
.title{
  font-size: 18px;
  font-weight: bold;
  color: #1890ff;
}
</style>
</style>

到此這篇關(guān)于Vue 使用html、css實(shí)現(xiàn)魚骨組件的文章就介紹到這了,更多相關(guān)Vue 魚骨組件內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • 京東 Vue3 組件庫(kù)支持小程序開發(fā)的詳細(xì)流程

    京東 Vue3 組件庫(kù)支持小程序開發(fā)的詳細(xì)流程

    這篇文章主要介紹了京東 Vue3 組件庫(kù)支持小程序開發(fā)的詳細(xì)流程,通過引入NutUI,即可在項(xiàng)目中使用,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2021-06-06
  • Vue3(二)集成Ant Design Vue

    Vue3(二)集成Ant Design Vue

    上一篇文章我們介紹了利用Vue3 創(chuàng)建Vue CLI 項(xiàng)目(一),接下來就來看看Vue3集成Ant Design Vue 的相關(guān)資料,需要的小伙伴可以參考一下文章的具體內(nèi)容
    2021-10-10
  • vue 中Virtual Dom被創(chuàng)建的方法

    vue 中Virtual Dom被創(chuàng)建的方法

    本文將通過解讀render函數(shù)的源碼,來分析vue中的vNode是如何創(chuàng)建的,本文通過實(shí)例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2019-04-04
  • 結(jié)合mint-ui移動(dòng)端下拉加載實(shí)踐方法總結(jié)

    結(jié)合mint-ui移動(dòng)端下拉加載實(shí)踐方法總結(jié)

    下面小編就為大家?guī)硪黄Y(jié)合mint-ui移動(dòng)端下拉加載實(shí)踐方法總結(jié)。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧
    2017-11-11
  • Vue獲取表單數(shù)據(jù)的多種方式

    Vue獲取表單數(shù)據(jù)的多種方式

    這篇文章主要給大家介紹了關(guān)于Vue獲取表單數(shù)據(jù)的多種方式,在Vue中我們通常使用v-model命令綁定表單的屬性值(通常是value),獲取到的屬性值就是表單數(shù)據(jù),需要的朋友可以參考下
    2023-09-09
  • vue常用指令實(shí)現(xiàn)學(xué)生錄入系統(tǒng)的實(shí)戰(zhàn)

    vue常用指令實(shí)現(xiàn)學(xué)生錄入系統(tǒng)的實(shí)戰(zhàn)

    本文主要介紹了vue常用指令實(shí)現(xiàn)學(xué)生錄入系統(tǒng)的實(shí)戰(zhàn),文中通過示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2022-02-02
  • 詳解element-ui中form驗(yàn)證雜記

    詳解element-ui中form驗(yàn)證雜記

    這篇文章主要介紹了詳解element-ui中form驗(yàn)證雜記,文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2019-03-03
  • vue 父組件通過v-model接收子組件的值的代碼

    vue 父組件通過v-model接收子組件的值的代碼

    這篇文章主要介紹了vue 父組件通過v-model接收子組件的值的代碼,代碼簡(jiǎn)單易懂,非常不錯(cuò),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下
    2019-10-10
  • vue引用BootStrap以及引用bootStrap-vue.js問題

    vue引用BootStrap以及引用bootStrap-vue.js問題

    這篇文章主要介紹了vue引用BootStrap以及引用bootStrap-vue.js問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-10-10
  • 使用ElementUI修改el-tabs標(biāo)簽頁(yè)組件樣式

    使用ElementUI修改el-tabs標(biāo)簽頁(yè)組件樣式

    這篇文章主要介紹了使用ElementUI修改el-tabs標(biāo)簽頁(yè)組件樣式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-08-08

最新評(píng)論