Vue组件样式模板

记录一下做过一些组件,因某些原因没能用在项目中。丢了又可惜,写篇博客存起来,以后用的时候直接copy

样式

在这里插入图片描述

<template>
  <div class="grid-content">
    <div class="grid-con-icon" :style="{'background': options.color}">{{options.title}}</div>
    <div class="grid-cont-right">
      <div :style="{'color': options.color}" class="count">
        <div class="big-num">
          {{options.newCount}}
        </div>
        /{{options.totalCount}}
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    options: {
      type: Object,
      default: function() {
        return {};
      }
    },
  }
}
</script>
<style lang='css' scoped>
.grid-content {
  height:100%;
  width: 100%;
  display: table;
  background: #fff;
  border: 1px solid #bbb;
}

.big-num {
  font-weight: bold;
  font-size: 40px;
  display: inline-block;
}

.grid-con-icon {
  padding: 0 2px;
  font-size: 15px;
  font-weight: 600;
  width: 30%;
  height: 100%;
  text-align: center;
  justify-content: center;
  color: #fff;
  display: table-cell;
  align-items: center;
  vertical-align: middle;
}

.grid-cont-right {
  width: 50%;
  font-size: 20px;
  display: table-cell;
  vertical-align: middle;
}

.count {
  align-items: baseline;
  text-align: center;
  margin: 0px 10px;
  font-size: 20px;
  font-weight: bold;
}

</style>

样式

在这里插入图片描述

<template>
    <div class="container">
      <div class="first">
        <div class="left">Schdule Job</div>
        <div class="right">Status</div>
      </div>
      <el-divider></el-divider>
      <div class="second">
        <div class="left number-align">
          <span class="number-pending">3</span>
          <span>Pending</span>
        </div>
        <div class="right number-align">
           <span class="number-failed">10</span>
           <span>Failed</span>
        </div>
      </div>
      <el-divider></el-divider>
      <div class="third">
        <div class="left">housekeep job</div>
        <div class="right"><span class="pending">Pending</span></div>
      </div>
      <el-divider></el-divider>
      <div class="fourth">
        <div class="left">SyncZabbixAlertToItoCenter</div>
        <div class="right"><span class="pending">Pending</span></div>
      </div>
    </div>
</template>

<script>
export default {
    name: "",
    data () {
        return {};
  },

    components: {},

    computed: {},

    methods: {}
}
</script>
<style lang='css' scoped>
.container {
  width: 100%;
  height: 220px;
  background: white;
}

.first {
  height: 20%;
  display: flex;
  width: 100%;
  align-items: center;
}

.second {
  display: flex;
  height: 35%;
  width: 100%;
  align-items: center;
}

.third {
  display: flex;
  height: 20%;
  width: 100%;
  align-items: center;
}

.fourth {
  width: 100%;
  display: flex;
  height: 20%;
  align-items: center;
}

.left {
  width: 50%;
  padding-left: 10px;
}

.right {
  width: 50%;
  text-align: center;
}

.pending {
  background: #E6A23C;
  color: white;
  padding: 2px 5px;
}

.number-pending {
  font-size: 50px;
  color:#E6A23C;
}

.number-failed {
  font-size: 50px;
  color:#db3630;
}

.number-align {
  text-align: center;
  align-items: baseline;
}

.el-divider--horizontal {
    display: block;
    height: 1px;
    width: 100%;
    margin: 1px;
}

</style>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值