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

60 lines
1.2 KiB
Vue
Raw Normal View History

<script setup lang="ts">
import { isDark } from '../composables/dark'
import { goldSponsors } from '../../config/sponsors'
import { sendEvent } from '../../config/analytics'
const onItemClick = (item: any) => {
sendEvent('sp_click', item.name, 'left_small_img')
}
</script>
<template>
2022-04-03 17:28:59 +08:00
<div class="sponsor-container">
<a
v-for="item in goldSponsors"
:key="item.name"
2022-04-03 17:28:59 +08:00
:class="[
'sponsor-item inline-flex items-center',
item.isDark && isDark ? 'filter invert' : '',
]"
:href="item.url"
:title="`${item.name_cn || item.name} - ${item.slogan_cn || item.slogan}`"
target="_blank"
@click="onItemClick(item)"
>
2022-04-03 17:28:59 +08:00
<img :src="item.img" :alt="item.name" />
</a>
</div>
</template>
<style scoped lang="scss">
2022-04-03 18:05:21 +08:00
@use '../styles/mixins' as *;
2022-04-03 17:28:59 +08:00
.sponsor-container {
display: flex;
align-items: center;
.sponsor-item {
margin-right: 4px;
2022-04-03 16:59:06 +08:00
height: 36px;
width: 36px;
2022-04-04 12:07:33 +08:00
@include respond-to('max') {
2022-04-03 18:05:21 +08:00
height: 44px;
width: 44px;
}
@media (max-width: 767px) {
width: 44px;
height: 44px;
}
2022-04-03 16:59:06 +08:00
img {
height: 100%;
width: 100%;
}
}
2022-04-04 01:30:47 +08:00
@include respond-to('xs') {
width: 196px;
}
}
</style>