popupHeader.vue 752 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <view class="header">
  3. <view class="title">{{title}} <text v-show="num">{{num?num:0}}</text></view>
  4. <text class="iconfont icon-guanbi5" @click="close"></text>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props: {
  10. //是否展示小字样式
  11. title: {
  12. type: String,
  13. default: '',
  14. },
  15. num: {
  16. type: Number,
  17. default: 0,
  18. }
  19. },
  20. methods: {
  21. close() {
  22. this.$emit('close');
  23. },
  24. }
  25. }
  26. </script>
  27. <style scoped lang="scss">
  28. .header {
  29. position: relative;
  30. text-align: center;
  31. margin-bottom: 50rpx;
  32. .title {
  33. color: #282828;
  34. font-size: 36rpx;
  35. font-weight: bold;
  36. }
  37. .iconfont {
  38. color: #8A8A8A;
  39. font-size: 36rpx;
  40. position: absolute;
  41. top: 4rpx;
  42. right: 0;
  43. }
  44. }
  45. </style>