index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view>
  3. <sjs src="../wxs/utils.sjs" module="utils" />
  4. <view :wx:if="(info !== null && info !== '') || dot" :class="'custom-class van-info ' + utils.bem('info', { dot })" :style="customStyle">{{ dot ? '' : info }}</view>
  5. </view>
  6. </template>
  7. <script>
  8. import { VantComponent } from '../common/component';
  9. export default {
  10. data() {
  11. return {};
  12. },
  13. props: {
  14. dot: Boolean,
  15. info: null,
  16. customStyle: String
  17. }
  18. };
  19. </script>
  20. <style>
  21. @import '../common/index.ttss';
  22. .van-info {
  23. position: absolute;
  24. top: 0;
  25. right: 0;
  26. box-sizing: border-box;
  27. white-space: nowrap;
  28. text-align: center;
  29. -webkit-transform: translate(50%, -50%);
  30. transform: translate(50%, -50%);
  31. -webkit-transform-origin: 100%;
  32. transform-origin: 100%;
  33. min-width: 16px;
  34. min-width: var(--info-size, 16px);
  35. padding: 0 3px;
  36. padding: var(--info-padding, 0 3px);
  37. color: #fff;
  38. color: var(--info-color, #fff);
  39. font-weight: 500;
  40. font-weight: var(--info-font-weight, 500);
  41. font-size: 12px;
  42. font-size: var(--info-font-size, 12px);
  43. font-family: PingFang SC, Helvetica Neue, Arial, sans-serif;
  44. font-family: var(--info-font-family, PingFang SC, Helvetica Neue, Arial, sans-serif);
  45. line-height: 14px;
  46. line-height: calc(var(--info-size, 16px) - var(--info-border-width, 1px) * 2);
  47. background-color: #ee0a24;
  48. background-color: var(--info-background-color, #ee0a24);
  49. border: 1px solid #fff;
  50. border: var(--info-border-width, 1px) solid var(--white, #fff);
  51. border-radius: 16px;
  52. border-radius: var(--info-size, 16px);
  53. }
  54. .van-info--dot {
  55. min-width: 0;
  56. border-radius: 100%;
  57. width: 8px;
  58. width: var(--info-dot-size, 8px);
  59. height: 8px;
  60. height: var(--info-dot-size, 8px);
  61. background-color: #ee0a24;
  62. background-color: var(--info-dot-color, #ee0a24);
  63. }
  64. </style>