提交 a13b3539 编写于 作者: D DCloud_LXH

feat: @dcloudio/uni-components export type EmitEvent and CustomEventTrigger。eg. video.tsx

上级 f7865c2e
export * from './components'
export { useOn, useSubscribe } from './helpers/useSubscribe'
export { withWebEvent, useCustomEvent } from './helpers/useEvent'
export {
withWebEvent,
useCustomEvent,
CustomEventTrigger,
EmitEvent,
} from './helpers/useEvent'
export { useUserAction } from './helpers/useUserAction'
export { useAttrs } from './helpers/useAttrs'
......@@ -7,7 +7,6 @@ import {
computed,
watch,
onMounted,
SetupContext,
renderList,
onBeforeUnmount,
} from 'vue'
......@@ -17,11 +16,12 @@ import { getRealPath } from '@dcloudio/uni-platform'
import {
useSubscribe,
useCustomEvent,
EmitEvent,
CustomEventTrigger,
useUserAction,
useAttrs,
} from '@dcloudio/uni-components'
type CustomEventTrigger = ReturnType<typeof useCustomEvent>
type UserActionState = ReturnType<typeof useUserAction>['state']
function formatTime(val: number): string {
......@@ -803,7 +803,7 @@ export default /*#__PURE__*/ defineComponent({
setup(props, { emit, attrs, slots }) {
const rootRef = ref(null)
const containerRef = ref(null)
const trigger = useCustomEvent(rootRef, emit as SetupContext['emit'])
const trigger = useCustomEvent<EmitEvent<typeof emit>>(rootRef, emit)
const { state: userActionState } = useUserAction()
const { $attrs: videoAttrs } = useAttrs({
excludeListeners: true,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册