index.vue 629 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="header" v-if="showTitle">
  3. <view class="line" />
  4. {{ title }}
  5. </view>
  6. </template>
  7. <script setup>
  8. import { defineProps, onMounted } from 'vue';
  9. const props = defineProps({
  10. title: {
  11. type: String,
  12. default: '',
  13. },
  14. showTitle: {
  15. type: Boolean,
  16. default: true,
  17. },
  18. });
  19. </script>
  20. <style scoped lang="less">
  21. .header {
  22. padding: 24rpx 0;
  23. color: #333;
  24. font-size: 16px;
  25. display: flex;
  26. align-items: center;
  27. font-weight: bold;
  28. .line {
  29. width: 4px;
  30. height: 20px;
  31. background: linear-gradient(to bottom, #f89c33, #f86834);
  32. margin-right: 16rpx;
  33. }
  34. }
  35. </style>