element-plus/docs/.vitepress/vitepress/components/vp-sponsor-large.vue

67 lines
1.2 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import { leftCustomImgSponsors } from '../../config/sponsors'
import { sendEvent } from '../../config/analytics'
2022-04-04 12:07:33 +08:00
defineProps({
itemClass: String,
itemStyle: [String, Object, Array],
})
const onItemClick = (item: any) => {
sendEvent('sp_click', item.name, 'left_custom_img')
}
</script>
2021-11-03 15:14:45 +08:00
<template>
2022-06-06 14:30:24 +08:00
<div>
2022-04-03 17:28:59 +08:00
<a
v-for="item in leftCustomImgSponsors"
2022-04-03 17:28:59 +08:00
:key="item.name"
:href="item.url"
:title="`${item.name_cn || item.name} - ${item.slogan_cn || item.slogan}`"
2022-04-04 12:07:33 +08:00
:class="['sponsor-item inline-flex', itemClass]"
:style="itemStyle"
2022-04-03 17:28:59 +08:00
target="_blank"
@click="onItemClick(item)"
2022-04-03 17:28:59 +08:00
>
<img :src="item.banner_img" :alt="item.name" />
</a>
2021-11-03 15:14:45 +08:00
</div>
</template>
<style scoped lang="scss">
2022-04-03 17:53:02 +08:00
@use '../styles/mixins.scss' as *;
2021-11-03 15:14:45 +08:00
.sponsor-item {
margin-bottom: 8px;
2022-04-03 16:59:06 +08:00
height: 60px;
2022-04-03 17:53:02 +08:00
width: 196px;
2022-04-04 12:07:33 +08:00
@include respond-to('max') {
2022-04-03 17:53:02 +08:00
width: 236px;
2022-04-03 18:37:29 +08:00
height: 72px;
2022-04-03 17:53:02 +08:00
}
@media (max-width: 767px) {
width: 236px;
height: 72px;
}
2021-11-03 15:14:45 +08:00
img {
border-radius: 8px;
overflow: hidden;
2022-04-03 17:53:02 +08:00
height: 100%;
width: 100%;
2021-11-03 15:14:45 +08:00
}
}
2022-04-03 17:53:02 +08:00
@media (max-width: 768px) {
.sponsor-item {
img {
border-radius: 4px;
min-height: 45px;
}
}
}
2021-11-03 15:14:45 +08:00
</style>