<template> | |
<text class="item txt" value="{{value}}" | |
style="background-color:{{bgColor()}}; "></text> | |
</template> | |
<script> | |
module.exports = { | |
data: { | |
value: '', | |
type: '0' // 0, 1 | |
}, | |
methods: { | |
bgColor: function() { | |
return this.type == '1' ? '#7BA3A8' : '#BEAD92'; | |
} | |
} | |
} | |
</script> | |
<style> | |
.item { | |
margin-right: 10px; | |
/*margin-bottom: 10px;*/ | |
width: 160px; | |
height: 75px; | |
padding-left: 8px; | |
padding-right: 8px; | |
padding-top: 8px; | |
padding-bottom: 8px; | |
} | |
.txt { | |
color: #eee; | |
} | |
</style> |