<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; white-space:normal; word-break:break-all; word-wrap:break-word; padding-left: 20px; } } </style>