news-recommend.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view class="news-recommend">
  3. <view v-if="recommendType === 'home'" class="news-tab">
  4. <u-tabs :active.sync="tabActive" :tabs="tabs" tab-style="default" @change="tabChange"/>
  5. </view>
  6. <view class="news-list">
  7. <template v-for="(item, index) in newsList">
  8. <news-item :item="item" :key="index" />
  9. </template>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import UTabs from '@/components/common/u-tabs'
  15. import NewsItem from '@/pages/news/components/news-item.vue'
  16. export default {
  17. components: {
  18. UTabs,
  19. NewsItem
  20. },
  21. props: {
  22. recommendType: {
  23. type: String,
  24. default: 'home'
  25. }
  26. },
  27. data() {
  28. return {
  29. tabActive: '1',
  30. tabs: [{
  31. label: '展会新闻',
  32. value: 1
  33. }, {
  34. label: '展商新闻',
  35. value: 2
  36. }],
  37. newsList: [{}, {}, {}]
  38. }
  39. },
  40. created() {
  41. },
  42. methods: {
  43. tabChange() {
  44. },
  45. onClickDetail(item) {
  46. this.navigateTo('https://www.productronicachina.com.cn/2025%E6%85%95%E5%B0%BC%E9%BB%91%E4%B8%8A%E6%B5%B7%E7%94%B5%E5%AD%90%E7%94%9F%E4%BA%A7%E8%AE%BE%E5%A4%87%E5%B1%953%E6%9C%88%E5%A5%8F%E5%93%8D%E6%96%B0%E7%AF%87%E7%AB%A0-%E6%8E%A2%E7%B4%A2%E7%94%B5%E5%AD%90%E5%88%B6%E9%80%A0%E7%9A%84%E6%97%A0%E9%99%90%E5%8F%AF%E8%83%BD')
  47. }
  48. }
  49. }
  50. </script>
  51. <style lang="scss" scoped>
  52. .news-list{
  53. display: grid;
  54. grid-template-columns: 1fr;
  55. grid-row-gap: 18rpx;
  56. margin-top: 28rpx;
  57. }
  58. </style>