<!-- 搜索表单 -->
<template>
    <div class="flex items-center">
        <div style="margin-right: 10px">ISBN</div>
        <el-input
            v-model="isbn"
            placeholder="请输入ISBN"
            style="width: 200px; margin-right: 10px"
        />
        <el-button type="primary" plain @click="search">查询</el-button>
        <el-button @click="reset">重置</el-button>
    </div>
</template>

<script setup>
    import { ref, defineEmits } from 'vue';

    const emit = defineEmits(['search']);
    const isbn = ref('');

    const search = () => {
        emit('search', { isbn: isbn.value });
    };

    const reset = () => {
        isbn.value = '';
        emit('search', { isbn: '' });
    };
</script>
