mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 20:04:09 +00:00
refactor(SwipeCell): refactor with composition api
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { on, off } from '../utils/dom/event';
|
||||
import {
|
||||
Ref,
|
||||
ref,
|
||||
isRef,
|
||||
watch,
|
||||
onMounted,
|
||||
onActivated,
|
||||
@@ -17,6 +19,10 @@ export function useGlobalEvent(
|
||||
) {
|
||||
let binded: boolean;
|
||||
|
||||
if (!isRef(target)) {
|
||||
target = ref(target);
|
||||
}
|
||||
|
||||
function add() {
|
||||
if (binded || (flag && !flag.value) || !target.value) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user