样式效果:

代码:
<style lang="less">
  .rowContainer {
    border: 1px solid #E5E5E5;
    font-size: 14px;
    .detailColAll{
      display: flex;
      width: 100%;
      line-height: 40px;
      border-right: 1px solid #E5E5E5;
      border-bottom: 1px solid #E5E5E5;
      float: left;
      .detailColTitle {
        border-right: 1px solid #E5E5E5;
        background-color: #BFBFBF;
        min-width: 120px;
      }

    }
    .detailCol {
      display: flex;
      width: 25%;
      line-height: 40px;
      border-right: 1px solid #E5E5E5;
      border-bottom: 1px solid #E5E5E5;
      float: left;
      .detailColTitle {
        border-right: 1px solid #E5E5E5;
        background-color: #BFBFBF;
        min-width: 120px;
      }

    }
  }

  .detailColDetail {
    padding: 10px;
  }
</style>
<template>
  <div class="rowContainer">
    <div :class="item.isLong?'detailColAll':'detailCol'" v-for="(item,index) in detailArr" :key="index">
      <div class="detailColTitle">
        <p class="detailColDetail">{{item.title}}</p>
      </div>
      <div class="detailColValue">
        <p class="detailColDetail" v-html="detailData[item.name]"></p>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "showDetail",
    data() {
      return {}
    },
    props: {
      detailArr: {
        type: Array,
        default: []
      },
      detailData: {
        type: Object,
        default: {}
      }
    }
  }
</script>

Logo

前往低代码交流专区

更多推荐