element-plus/docs/.vitepress/vitepress/components/vp-sponsor-large.vue
0song 56fee15685
chore: add right sponsors (#7567)
* chore: add spon

* chore: add spon dark

* chore: add spon ui

* chore: add spon ui2

* chore: add analytics

* chore: add readme
2022-05-09 08:49:28 +08:00

67 lines
1.2 KiB
Vue

<script setup lang="ts">
import { leftCustomImgSponsors } from '../../config/sponsors'
import { sendEvent } from '../../config/analytics'
defineProps({
itemClass: String,
itemStyle: [String, Object, Array],
})
const onItemClick = (item: any) => {
sendEvent('sp_click', item.name, 'left_custom_img')
}
</script>
<template>
<div class="sponsor-container">
<a
v-for="item in leftCustomImgSponsors"
:key="item.name"
:href="item.url"
:title="`${item.name_cn || item.name} - ${item.slogan_cn || item.slogan}`"
:class="['sponsor-item inline-flex', itemClass]"
:style="itemStyle"
target="_blank"
@click="onItemClick(item)"
>
<img :src="item.banner_img" :alt="item.name" />
</a>
</div>
</template>
<style scoped lang="scss">
@use '../styles/mixins.scss' as *;
.sponsor-item {
margin-bottom: 8px;
height: 60px;
width: 196px;
@include respond-to('max') {
width: 236px;
height: 72px;
}
@media (max-width: 767px) {
width: 236px;
height: 72px;
}
img {
border-radius: 8px;
overflow: hidden;
height: 100%;
width: 100%;
}
}
@media (max-width: 768px) {
.sponsor-item {
img {
border-radius: 4px;
min-height: 45px;
}
}
}
</style>