LayoutRow.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <template>
  2. <view class="layout-row">
  3. <u-row
  4. justify="space-between"
  5. gutter="10">
  6. <u-col span="4">
  7. <view class="demo-layout">{{rowTitle?rowTitle:""}}</view>
  8. </u-col>
  9. <u-col span="8">
  10. <view class="demo-layout2" v-if="rowTitle==='设备状态'" :style="{color:`${rowValue==='可借出'?'#19be6b':rowValue==='已借出'?'#fa3534':'#ff9900'}`}">
  11. <i class="iconfont icon-yuandian"></i>
  12. <text>{{rowValue?rowValue:""}}</text>
  13. </view>
  14. <view class="demo-layout" v-else>{{rowValue?rowValue:""}}</view>
  15. </u-col>
  16. </u-row>
  17. </view>
  18. </template>
  19. <script>
  20. export default{
  21. data(){
  22. return{
  23. // rowTitle:"存放地点",
  24. // rowValue:"222"
  25. }
  26. },
  27. props: {
  28. rowTitle: { // 接收父组件传入值
  29. type: String || "",
  30. default: ""
  31. },
  32. rowValue: { // 接收父组件传入值
  33. type: String || "",
  34. default: ""
  35. },
  36. }
  37. }
  38. </script>
  39. <style lang="scss">
  40. .layout-row{
  41. border-top: 1rpx solid #d6d7d9;
  42. padding: 20rpx 0 ;
  43. }
  44. .demo-layout {
  45. height: 25px;
  46. box-sizing: border-box;
  47. // padding: 0 10rpx;
  48. }
  49. .demo-layout2 {
  50. height: 25px;
  51. box-sizing: border-box;
  52. display: flex;
  53. align-items: center;
  54. // padding: 0 10rpx;
  55. }
  56. </style>