UNPKG

@aplus-frontend/antdv

Version:

Vue basic component library maintained based on ant-design-vue

13 lines 293 B
import { getCurrentScope, onScopeDispose } from 'vue'; /** * Call onScopeDispose() if it's inside a effect scope lifecycle, if not, do nothing * * @param fn */ export function tryOnScopeDispose(fn) { if (getCurrentScope()) { onScopeDispose(fn); return true; } return false; }