Initial project
This commit is contained in:
20
src/components/comment/form/reply/emits.ts
Normal file
20
src/components/comment/form/reply/emits.ts
Normal file
@ -0,0 +1,20 @@
|
||||
import { CommentReply } from "timi-web";
|
||||
|
||||
/**
|
||||
* emits
|
||||
*/
|
||||
export interface Emits {
|
||||
(event: "cancel"): Promise<void>;
|
||||
(event: "submit", reply: CommentReply): Promise<void>;
|
||||
}
|
||||
|
||||
export const useHandler = (emit: Emits) => {
|
||||
|
||||
const onCancel = async () => await emit("cancel");
|
||||
const onSubmit = async (reply: CommentReply) => await emit("submit", reply);
|
||||
|
||||
return {
|
||||
onCancel,
|
||||
onSubmit
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user