status-tip.vue 936 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <template>
  2. <view @click="clickItem">
  3. <view class="tip-wrap">
  4. <view class="name">{{ name }}</view>
  5. <view class="status-wrap">
  6. <view :class="status ? 'success' : 'error'"></view>
  7. <view v-if="tip" class="tip">{{ tip }}</view>
  8. </view>
  9. </view>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. data() {
  15. return {
  16. }
  17. },
  18. props: ['name','status','tip'],
  19. onLoad() {
  20. },
  21. methods: {
  22. clickItem() {
  23. this.$emit('clickItem',this.name)
  24. }
  25. }
  26. }
  27. </script>
  28. <style scoped lang="scss">
  29. .tip-wrap {
  30. display: flex;
  31. align-content: center;
  32. .name {
  33. }
  34. .status-wrap {
  35. display: flex;
  36. align-items: center;
  37. .success {
  38. width: 30rpx;
  39. height: 30rpx;
  40. background: #00BD00;
  41. border-radius: 6rpx;
  42. margin-right: 7rpx;
  43. }
  44. .error {
  45. width: 30rpx;
  46. height: 30rpx;
  47. background: #D6000F;
  48. border-radius: 6rpx;
  49. margin-right: 7rpx;
  50. }
  51. .tip {
  52. }
  53. }
  54. }
  55. </style>