From 1e86df7937a99cc7ecd5229b65a54613aa6f38b4 Mon Sep 17 00:00:00 2001 From: maochaoying <925670706@qq.com> Date: Sun, 25 Jun 2023 15:42:13 +0800 Subject: [PATCH] news --- src/components/News.vue | 16 ++++++++++++---- src/components/Top.vue | 1 - 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/News.vue b/src/components/News.vue index afcad01..61c8cb7 100644 --- a/src/components/News.vue +++ b/src/components/News.vue @@ -4,15 +4,15 @@
-
+

{{ item.title }}

- +
-

{{ item.list[index].productTitle }}

-

{{ item.list[index].desc }}

+

{{ getList()[index].productTitle }}

+

{{ getList()[index].desc }}

@@ -24,6 +24,14 @@ import HeadLine from 'cpns/HeadLine' import { newsList } from '@/mock' import { ref } from 'vue' const activeTab = ref(1) +const changeActiveWrap = id => { + activeTab.value = id +} + +const getList = () => { + const arr = newsList.filter(item => item.id == activeTab.value) + return arr[0].list +}