<template>
<el-input
v-model="keyword"
suffix-icon="search"
placeholder="请输入关键字"
clearable
@keyup.enter.prevent="searchHandle"
/>
</template>
<script setup lang="ts">
/**
* 按下回车键搜索方法
*/
const searchHandle = () => {
console.log("回车键按下");
};
</script>
<style lang="scss" scoped></style>
vue3 element-plus 按下回车键搜索方法
最新推荐文章于 2024-09-03 17:02:58 发布