index.vue 876 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <template>
  2. <view class="container">
  3. <navbar></navbar>
  4. <uni-list>
  5. <uni-list-item v-for="(item, index) in contentList" :key="index" :title="item.title" :note="item.describe" showArrow
  6. :thumb="`${baseurl}${item.thumbnail}`"
  7. thumb-size="lg" rightText="详情" />
  8. </uni-list>
  9. </view>
  10. </template>
  11. <script>
  12. import { mapActions, mapState } from 'vuex'
  13. export default {
  14. onLoad: function (option) { //option为object类型,会序列化上个页面传递的参数
  15. this.column = option.column;
  16. },
  17. computed: {
  18. ...mapState(['contentList'])
  19. },
  20. data() {
  21. return {
  22. column: '',
  23. baseurl: 'http://192.168.3.45:9002',
  24. }
  25. },
  26. async mounted() {
  27. await this.contentQuery({ column: this.column });
  28. },
  29. methods: {
  30. ...mapActions(['contentQuery'])
  31. }
  32. }
  33. </script>
  34. <style>
  35. </style>