UNPKG

bootstrap-vue

Version:

With more than 85 components, over 45 available plugins, several directives, and 1000+ icons, BootstrapVue provides one of the most comprehensive implementations of the Bootstrap v4 component and grid system available for Vue.js v2.6, complete with extens

39 lines (31 loc) 795 B
import { isVue3 } from '../vue'; var registry = null; if (isVue3) { registry = new WeakMap(); } export var registerElementToInstance = function registerElementToInstance(element, instance) { if (!isVue3) { return; } registry.set(element, instance); }; export var removeElementToInstance = function removeElementToInstance(element) { if (!isVue3) { return; } registry.delete(element); }; export var getInstanceFromElement = function getInstanceFromElement(element) { if (!isVue3) { return element.__vue__; } var currentElement = element; while (currentElement) { if (registry.has(currentElement)) { /* istanbul ignore next */ return registry.get(currentElement); } currentElement = currentElement.parentNode; } return null; };