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 +}