<template>
    <Search class="app-search" :class="[`bg-${background}`]" :placeholder="t('digital.search')">
        <template #left-icon>
            <img :src="'./img/icons/search.svg'" :title="t('digital.search')" />
        </template>
        <template #right-icon>
            <slot></slot>
        </template>
    </Search>
</template>

<script lang="ts" setup>
import { PropType } from 'vue'
import { Search } from 'vant'
import { i18n } from '@/stores'

defineProps({
    // 背景颜色
    background: {
        type: String as PropType<'default' | 'primary'>,
        default: 'default'
    },
})

const t = i18n.global.t
</script>

<style lang="less">
@import './index.less';
</style>