Skip to content

Commit

Permalink
refactor: 优化事件的ts类型
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoJikun committed May 26, 2024
1 parent b05c78b commit f3466cc
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 17 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"name": "fox-preview-image",
"description": "一个支持 vue3 的预览图片组件",
"version": "3.0.0",
"type": "module",
"main": "lib/preview-image.js",
"module": "lib/preview-image.mjs",
"browser": "lib/preview-image.js",
Expand Down Expand Up @@ -60,6 +61,7 @@
"jsdom": "^24.0.0",
"npm-run-all2": "^6.1.2",
"prettier": "^3.2.5",
"sass": "^1.77.2",
"typescript": "~5.4.0",
"vite": "^5.2.8",
"vite-plugin-vue-devtools": "^7.0.25",
Expand Down
93 changes: 79 additions & 14 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/components/preview-image/src/switch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import ArrowRight from '@/components/arrow-right.vue'
const emit = defineEmits<{
(e: 'prev'): void
(e: 'next'): void
prev: []
next: []
}>()
const handlePrevClick = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/preview-image/src/toolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const props = withDefaults(defineProps<Props>(), {
index: '1/1'
})
const emit = defineEmits(['click'])
const emit = defineEmits<{ click: [type: OperateType]}>()
type OperateType = 'zoom-out' | 'zoom-in' | 'contraRotate' | 'clockwiseRotation' | 'download'
Expand Down

0 comments on commit f3466cc

Please sign in to comment.