<template> <div class="item"> <div class="name">{{data.name}}</div> <div class="value" :style="{'color': data.color}">{{data.value}}</div> </div> </template> <script> export default { name: 'Item', props: { data: { type: Object, default: () => { return { name: '标题', // 标题 value: '***', // 数值 color: '#50C55C' } } } }, data() { return { } }, created() { }, methods: { } } </script> <style rel="stylesheet/scss" lang="scss" scoped> .item{ width: 100%; display: flex; flex-direction: row; font-size: 15px; .name{ color: white; min-width: 30px; } .value{ flex: 1; float: left; overflow:auto; /*white-space:normal;*/ word-break:break-all; word-wrap:break-word; padding-left: 10px; white-space:pre-wrap; max-height: 90px; } } //定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸 ::-webkit-scrollbar{ width: 5px; height: 5px; } //定义滑块 内阴影+圆角 ::-webkit-scrollbar-thumb{ border-radius: 1em; background-color: rgba(93, 162, 180, 0.3) !important; } //定义滚动条轨道 内阴影+圆角 ::-webkit-scrollbar-track{ border-radius: 1em; background-color: rgba(14, 57, 149, 0.1) !important; } </style>