fix: eslint
parent
db7b7cd047
commit
54e93835d6
|
@ -23,11 +23,6 @@ const props = defineProps({
|
|||
mode: propTypes.oneOf(['svg', 'iconify']).def('iconify'),
|
||||
})
|
||||
const emit = defineEmits(['change', 'update:value'])
|
||||
// 没有使用别名引入,是因为WebStorm当前版本还不能正确识别,会报unused警告
|
||||
const AInput = Input
|
||||
const APopover = Popover
|
||||
const APagination = Pagination
|
||||
const AEmpty = Empty
|
||||
|
||||
function getIcons() {
|
||||
const data = iconsData as any
|
||||
|
@ -107,12 +102,12 @@ function handleSearchChange(e: ChangeEvent) {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<AInput v-model:value="currentSelect" disabled :style="{ width }" :placeholder="t('component.icon.placeholder')" :class="prefixCls">
|
||||
<Input v-model:value="currentSelect" disabled :style="{ width }" :placeholder="t('component.icon.placeholder')" :class="prefixCls">
|
||||
<template #addonAfter>
|
||||
<APopover v-model="open" placement="bottomLeft" trigger="click" :overlay-class-name="`${prefixCls}-popover`">
|
||||
<Popover v-model="open" placement="bottomLeft" trigger="click" :overlay-class-name="`${prefixCls}-popover`">
|
||||
<template #title>
|
||||
<div class="flex justify-between">
|
||||
<AInput :placeholder="t('component.icon.search')" allow-clear @change="debounceHandleSearchChange" />
|
||||
<Input :placeholder="t('component.icon.search')" allow-clear @change="debounceHandleSearchChange" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -135,12 +130,12 @@ function handleSearchChange(e: ChangeEvent) {
|
|||
</ul>
|
||||
</ScrollContainer>
|
||||
<div v-if="getTotal >= pageSize" class="flex py-2 items-center justify-center">
|
||||
<APagination show-less-items size="small" :page-size="pageSize" :total="getTotal" @change="handlePageChange" />
|
||||
<Pagination show-less-items size="small" :page-size="pageSize" :total="getTotal" @change="handlePageChange" />
|
||||
</div>
|
||||
</div>
|
||||
<template v-else>
|
||||
<div class="p-5">
|
||||
<AEmpty />
|
||||
<Empty />
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
@ -149,9 +144,9 @@ function handleSearchChange(e: ChangeEvent) {
|
|||
<SvgIcon :name="currentSelect" />
|
||||
</span>
|
||||
<Icon v-else :icon="currentSelect || 'ion:apps-outline'" class="cursor-pointer px-2 py-1" />
|
||||
</APopover>
|
||||
</Popover>
|
||||
</template>
|
||||
</AInput>
|
||||
</Input>
|
||||
</template>
|
||||
|
||||
<style lang="less">
|
||||
|
|
|
@ -17,7 +17,7 @@ import { useDesign } from '@/hooks/web/useDesign'
|
|||
defineOptions({ name: 'BasicModal', inheritAttrs: false })
|
||||
|
||||
const props = defineProps(basicProps)
|
||||
const emit = defineEmits(['open-change', 'height-change', 'cancel', 'ok', 'register', 'update:open'])
|
||||
const emit = defineEmits(['openChange', 'heightChange', 'cancel', 'ok', 'register', 'update:open'])
|
||||
const attrs = useAttrs()
|
||||
const openRef = ref(false)
|
||||
const propsRef = ref<Partial<ModalProps> | null>(null)
|
||||
|
@ -72,7 +72,7 @@ const getProps = computed((): Recordable => {
|
|||
})
|
||||
|
||||
const getBindValue = computed((): Recordable => {
|
||||
const attr = {
|
||||
const attr: any = {
|
||||
...attrs,
|
||||
...unref(getMergeProps),
|
||||
open: unref(openRef),
|
||||
|
@ -98,7 +98,7 @@ watchEffect(() => {
|
|||
watch(
|
||||
() => unref(openRef),
|
||||
(v) => {
|
||||
emit('open-change', v)
|
||||
emit('openChange', v)
|
||||
emit('update:open', v)
|
||||
instance && modalMethods.emitOpen?.(v, instance.uid)
|
||||
nextTick(() => {
|
||||
|
@ -146,7 +146,7 @@ function handleOk(e: Event) {
|
|||
}
|
||||
|
||||
function handleHeightChange(height: string) {
|
||||
emit('height-change', height)
|
||||
emit('heightChange', height)
|
||||
}
|
||||
|
||||
function handleExtHeight(height: number) {
|
||||
|
|
|
@ -20,7 +20,7 @@ const props = defineProps({
|
|||
fullScreen: { type: Boolean },
|
||||
loadingTip: { type: String },
|
||||
})
|
||||
const emit = defineEmits(['height-change', 'ext-height'])
|
||||
const emit = defineEmits(['heightChange', 'extHeight'])
|
||||
const wrapperRef = ref<ComponentRef>(null)
|
||||
const spinRef = ref<ElRef>(null)
|
||||
const realHeightRef = ref(0)
|
||||
|
@ -30,7 +30,7 @@ let realHeight = 0
|
|||
|
||||
const stopElResizeFn: Fn = () => {}
|
||||
|
||||
useWindowSizeFn(setModalHeight.bind(null, false))
|
||||
useWindowSizeFn(setModalHeight.bind(false))
|
||||
|
||||
useMutationObserver(
|
||||
spinRef,
|
||||
|
@ -71,7 +71,7 @@ watch(
|
|||
|
||||
onMounted(() => {
|
||||
const { modalHeaderHeight, modalFooterHeight } = props
|
||||
emit('ext-height', modalHeaderHeight + modalFooterHeight)
|
||||
emit('extHeight', modalHeaderHeight + modalFooterHeight)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
|
@ -130,7 +130,7 @@ async function setModalHeight() {
|
|||
else
|
||||
realHeightRef.value = props.height ? props.height : realHeight > maxHeight ? maxHeight : realHeight
|
||||
|
||||
emit('height-change', unref(realHeightRef))
|
||||
emit('heightChange', unref(realHeightRef))
|
||||
}
|
||||
catch (error) {
|
||||
console.log(error)
|
||||
|
|
|
@ -55,7 +55,7 @@ const prefixCls = 'img-preview'
|
|||
export default defineComponent({
|
||||
name: 'ImagePreview',
|
||||
props,
|
||||
emits: ['img-load', 'img-error'],
|
||||
emits: ['imgLoad', 'imgError'],
|
||||
setup(props, { expose, emit }) {
|
||||
interface stateInfo {
|
||||
scale: number
|
||||
|
@ -201,7 +201,7 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
ele
|
||||
&& emit('img-load', {
|
||||
&& emit('imgLoad', {
|
||||
index: imgState.currentIndex,
|
||||
dom: ele[0] as HTMLImageElement,
|
||||
url,
|
||||
|
@ -213,7 +213,7 @@ export default defineComponent({
|
|||
img.onerror = (e: Event) => {
|
||||
const ele: EventTarget[] = e.composedPath()
|
||||
ele
|
||||
&& emit('img-error', {
|
||||
&& emit('imgError', {
|
||||
index: imgState.currentIndex,
|
||||
dom: ele[0] as HTMLImageElement,
|
||||
url,
|
||||
|
|
Loading…
Reference in New Issue