-
Notifications
You must be signed in to change notification settings - Fork 657
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c76f8bc
commit e548668
Showing
4 changed files
with
101 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
import Search from './src/Search.vue' | ||
import { ElForm } from 'element-plus' | ||
|
||
export interface SearchExpose { | ||
getElFormExpose: () => Promise<ComponentRef<typeof ElForm>> | ||
} | ||
|
||
export { Search } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<script setup lang="ts"> | ||
import { ElButton } from 'element-plus' | ||
import { useIcon } from '@/hooks/web/useIcon' | ||
import { propTypes } from '@/utils/propTypes' | ||
import { useI18n } from '@/hooks/web/useI18n' | ||
const emit = defineEmits(['search', 'reset', 'expand']) | ||
const { t } = useI18n() | ||
defineProps({ | ||
showSearch: propTypes.bool.def(true), | ||
showReset: propTypes.bool.def(true), | ||
// 是否显示伸缩 | ||
showExpand: propTypes.bool.def(false), | ||
visible: propTypes.bool.def(true) | ||
}) | ||
const onSearch = () => { | ||
emit('search') | ||
} | ||
const onReset = () => { | ||
emit('reset') | ||
} | ||
const onExpand = () => { | ||
emit('expand') | ||
} | ||
</script> | ||
|
||
<template> | ||
<ElButton | ||
v-if="showSearch" | ||
type="primary" | ||
:icon="useIcon({ icon: 'ep:search' })" | ||
@click="onSearch" | ||
> | ||
{{ t('common.query') }} | ||
</ElButton> | ||
<ElButton v-if="showReset" :icon="useIcon({ icon: 'ep:refresh-right' })" @click="onReset"> | ||
{{ t('common.reset') }} | ||
</ElButton> | ||
<ElButton | ||
v-if="showExpand" | ||
:icon="useIcon({ icon: visible ? 'ant-design:up-outlined' : 'ant-design:down-outlined' })" | ||
text | ||
@click="onExpand" | ||
> | ||
{{ t(visible ? 'common.shrink' : 'common.expand') }} | ||
</ElButton> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters