perf: tsx use useExpose

This commit is contained in:
vben
2020-12-08 22:53:29 +08:00
parent 29461a8568
commit 9bb751475d
14 changed files with 63 additions and 55 deletions

View File

@@ -59,22 +59,22 @@
components: { BasicDragVerify, BugOutlined, RightOutlined },
setup() {
const { createMessage } = useMessage();
const el1 = ref<RefInstanceType<DragVerifyActionType>>(null);
const el2 = ref<RefInstanceType<DragVerifyActionType>>(null);
const el3 = ref<RefInstanceType<DragVerifyActionType>>(null);
const el4 = ref<RefInstanceType<DragVerifyActionType>>(null);
const el5 = ref<RefInstanceType<DragVerifyActionType>>(null);
const el1 = ref<Nullable<DragVerifyActionType>>(null);
const el2 = ref<Nullable<DragVerifyActionType>>(null);
const el3 = ref<Nullable<DragVerifyActionType>>(null);
const el4 = ref<Nullable<DragVerifyActionType>>(null);
const el5 = ref<Nullable<DragVerifyActionType>>(null);
function handleSuccess(data: PassingData) {
const { time } = data;
createMessage.success(`校验成功,耗时${time}`);
}
function handleBtnClick(elRef: RefInstanceType<DragVerifyActionType>) {
function handleBtnClick(elRef: Nullable<DragVerifyActionType>) {
if (!elRef) {
return;
}
elRef.$.resume();
elRef.resume();
}
return {
handleSuccess,