index.vue 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view>
  3. <model1 :shareNumber='shareNumber' :isDefault='isDefault' v-if="modelId==3||modelId==1" :templateDetail='templateData' :isShare='isShare' :isLook='isLook'></model1>
  4. <model2 :shareNumber='shareNumber' :isDefault='isDefault' v-if="modelId==4" :templateDetail='templateData' :isShare='isShare' :isLook='isLook'></model2>
  5. <model3 :shareNumber='shareNumber' :isDefault='isDefault' v-if="modelId==5" :templateDetail='templateData' :isShare='isShare' :isLook='isLook'></model3>
  6. </view>
  7. </template>
  8. <script>
  9. import model1 from './modeltemplate/model_1.vue';
  10. import model2 from './modeltemplate/model_2.vue'
  11. import model3 from './modeltemplate/model_3.vue'
  12. export default {
  13. props: {
  14. // 浏览数量
  15. shareNumber: {
  16. type: Number,
  17. default:0
  18. },
  19. // 是否显示默认数据
  20. isDefault: {
  21. type: Boolean,
  22. default:true
  23. },
  24. templateData: {
  25. type: Object,
  26. default: ()=>{
  27. return {}
  28. }
  29. },
  30. isShare:{
  31. type: Boolean,
  32. default:false
  33. },
  34. //1为模板2为用户
  35. isLook:{
  36. type: Number,
  37. default:0
  38. },
  39. modelId:{
  40. type: Number,
  41. default:0
  42. },
  43. },
  44. components: {
  45. model1,
  46. model2,
  47. model3
  48. },
  49. data() {
  50. return {
  51. model: 0
  52. }
  53. },
  54. onLoad() {
  55. console.log('233');
  56. uni.postMessage('打开页面')
  57. },
  58. onUnload() {
  59. uni.postMessage('关闭页面')
  60. }
  61. }
  62. </script>