search.vue 782 B

123456789101112131415161718192021222324252627282930313233
  1. <template>
  2. <el-row :gutter="20">
  3. <el-col :span="24" class="top-search">
  4. <div>
  5. <slot />
  6. <el-button type="primary" icon="Search" @click="handle('search')">查询</el-button>
  7. <el-button icon="RefreshLeft" @click="handle('reset')">重置</el-button>
  8. </div>
  9. <div>
  10. <el-button type="primary" icon="Plus" @click="handle('add')">{{addText}}</el-button>
  11. <slot name="afterBtn"/>
  12. </div>
  13. </el-col>
  14. </el-row>
  15. </template>
  16. <script setup lang="ts">
  17. import { ref,reactive } from 'vue'
  18. const props = defineProps({
  19. addText: String
  20. })
  21. const emit = defineEmits(['handle'])
  22. const name = ref<string>('')
  23. const params = reactive({
  24. name: '',
  25. page: 1,
  26. size: 20
  27. })
  28. const handle=(event)=>{
  29. emit("handle",event)
  30. }
  31. </script>