<script setup>
// 支持的属性：
//  beginIcon - 开头的Icon
//  endIcon - 结尾的Icon

import IconField from "primevue/iconfield";
import InputIcon from "primevue/inputicon";

const props = defineProps({
	beginIcon: null,
	endIcon: null
})

</script>

<template>
	<IconField>
		<InputIcon v-if="typeof props.beginIcon === 'string' && props.beginIcon.length > 0"
				   :class="beginIcon"></InputIcon>
		<slot></slot>
		<InputIcon v-if="typeof props.endIcon === 'string' && props.endIcon.length > 0"
				   :class="endIcon"></InputIcon>
	</IconField>
</template>

<style scoped>

</style>