detail.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class='detail'>
  3. <component :is="componentType"></component>
  4. </view>
  5. </template>
  6. <script>
  7. import JoinHall from './component/hall';
  8. import JoinGame from './component/game';
  9. import JoinTown from './component/town';
  10. export default {
  11. data() {
  12. return {
  13. type: '1'
  14. }
  15. },
  16. components: {
  17. JoinHall,
  18. JoinGame,
  19. JoinTown
  20. },
  21. computed: {
  22. componentType() {
  23. if (this.type == 1) {
  24. return 'join-hall'
  25. } else if (this.type == 2) {
  26. return 'join-game'
  27. } else if (this.type == 3) {
  28. return 'join-town'
  29. }
  30. return ''
  31. }
  32. },
  33. onLoad(options) {
  34. this.type = options.type
  35. let title = '逻辑狗思维体育馆';
  36. if (this.type == 1) {
  37. title = '逻辑狗思维体育馆'
  38. } else if (this.type == 2) {
  39. title = '思维芯教室'
  40. } else if (this.type == 3) {
  41. title = '逻辑狗探索小镇'
  42. } else {
  43. title = '逻辑狗思维体育馆';
  44. }
  45. uni.setNavigationBarTitle({
  46. title: title
  47. });
  48. },
  49. onShow() {
  50. },
  51. methods: {
  52. }
  53. }
  54. </script>
  55. <style lang="scss" scoped>
  56. </style>