<script setup>
// 使用Icon的链接方式

const props = defineProps(["href", "title", "target", "size"])

const {vTitle, realSize} = (function () {
	let realSize = props.size
	if (realSize == null || realSize.length == 0) {
		realSize = "small"
	}

	return {
		vTitle: (props.title == null) ? "点击打开链接" : props.title,
		realSize: realSize
	}
})()

</script>

<template>
	<span><slot></slot>&nbsp;<a :href="href" v-tooltip.bottom="vTitle" class="link grey" :target="target"><i class="pi pi-link" :class="realSize"></i></a></span>
</template>

<style scoped>

</style>