提交 19c32424 authored 作者: lihuihui's avatar lihuihui

跟新跳转

上级 15e53ad0
<template> <template>
<div> <div>
<template v-if="item.news"> <template v-if="item.news">
<template v-if="item.news.data.source !== ''"> <nuxt-link
<a v-if="typeof item.news.data.source == 'string'"
:href="item.href" :target="item.news.data.source !== '' ? '_blank' : '_self'"
target="_blank" :to="item.news.data.source !== '' ? item.news.data.source : `${item.news.path}/${item.news.data.id}`">
>
<slot /> <slot />
</a> </nuxt-link>
</template>
<template v-else>
<nuxt-link :to="`${item.news.path}/${item.news.data.id}`"><slot /></nuxt-link>
</template>
</template> </template>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
props: { item: { type: Object } }, props: { item: { type: Object } }
mounted() {
}
} }
</script> </script>
...@@ -45,17 +45,6 @@ export default { ...@@ -45,17 +45,6 @@ export default {
} }
} }
}, },
// async fetch() {
// const params = {
// terminal_type: 'WWW',
// ad_position_uri: 'www.ezijing.com'
// }
// this.bannerData = await this.$axios.get('/api/zws/v1/marketing/advertisements', { params }).then(res => {
// return res.filter((item, index) => {
// return index < 4
// })
// })
// },
async fetch() { async fetch() {
const params = { const params = {
page: 1, page: 1,
...@@ -82,18 +71,6 @@ export default { ...@@ -82,18 +71,6 @@ export default {
}, },
swiperStart() { swiperStart() {
this.swiper.autoplay.start() this.swiper.autoplay.start()
},
goPage(item) {
if (item.source === '') {
this.$router.push({
path: '/about/news-detail',
query: {
id: item.id
}
})
} else {
window.open(item.source)
}
} }
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论