element-plus/docs/.vitepress/vitepress/components/navbar/vp-social-link.vue
Aex f78407a409
fix(components): empty icon component judgment (#4178)
* fix(components): empty icon component judgment

* revert: globals components

* fix(components): el-icon missing import

* fix: use shallowRef for icon components

* refactor: remove shallowRef

* fix: remove unused code

* fix: social-link icon size

* fix: time picker icon

* fix: v-if judge
2021-11-05 17:44:02 +08:00

31 lines
470 B
Vue

<script setup lang="ts">
import type { Component } from 'vue'
defineProps<{
icon: Component
link: string
text: string
}>()
</script>
<template>
<a
:href="link"
:title="text"
target="_blank"
rel="noreferrer noopener"
class="social-link"
>
<ElIcon v-if="icon" :size="20">
<component :is="icon" />
</ElIcon>
</a>
</template>
<style scoped lang="scss">
.social-link {
padding: 0 4px;
color: var(--text-color);
}
</style>