detail.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <view class='detail'>
  3. <component :is="componentType"></component>
  4. </view>
  5. </template>
  6. <script>
  7. import ActivityThinking from './component/thinking';
  8. import ActivityCommunication from './component/communication';
  9. import ActivityGrow from './component/grow';
  10. export default {
  11. data() {
  12. return {
  13. type: '1'
  14. }
  15. },
  16. components: {
  17. ActivityThinking,
  18. ActivityCommunication,
  19. ActivityGrow
  20. },
  21. computed: {
  22. componentType() {
  23. if (this.type == 1) {
  24. return 'activity-thinking'
  25. } else if (this.type == 2) {
  26. return 'activity-communication'
  27. } else if (this.type == 3) {
  28. return 'activity-grow'
  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>