index.js 837 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { VantComponent } from '../common/component';
  2. VantComponent({
  3. classes: ['title-class'],
  4. props: {
  5. title: String,
  6. fixed: Boolean,
  7. leftText: String,
  8. rightText: String,
  9. leftArrow: Boolean,
  10. border: {
  11. type: Boolean,
  12. value: true
  13. },
  14. zIndex: {
  15. type: Number,
  16. value: 1
  17. },
  18. safeAreaInsetTop: {
  19. type: Boolean,
  20. value: true
  21. },
  22. },
  23. data: {
  24. statusBarHeight: 0
  25. },
  26. created() {
  27. const { statusBarHeight } = wx.getSystemInfoSync();
  28. this.setData({ statusBarHeight });
  29. },
  30. methods: {
  31. onClickLeft() {
  32. this.$emit('click-left');
  33. },
  34. onClickRight() {
  35. this.$emit('click-right');
  36. }
  37. }
  38. });