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

跟新跳转

上级 15e53ad0
<template>
<div>
<template v-if="item.news">
<template v-if="item.news.data.source !== ''">
<a
:href="item.href"
target="_blank"
>
<slot />
</a>
</template>
<template v-else>
<nuxt-link :to="`${item.news.path}/${item.news.data.id}`"><slot /></nuxt-link>
</template>
<nuxt-link
v-if="typeof item.news.data.source == 'string'"
:target="item.news.data.source !== '' ? '_blank' : '_self'"
:to="item.news.data.source !== '' ? item.news.data.source : `${item.news.path}/${item.news.data.id}`">
<slot />
</nuxt-link>
</template>
</div>
</template>
<script>
export default {
props: { item: { type: Object } },
mounted() {
}
props: { item: { type: Object } }
}
</script>
......@@ -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() {
const params = {
page: 1,
......@@ -82,18 +71,6 @@ export default {
},
swiperStart() {
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论