UNPKG

winbox-ui-next

Version:

We Design Vue 2.0: A Vue.js 3 UI Library

25 lines (24 loc) 794 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports[Symbol.toStringTag] = "Module"; var vue = require("vue"); var vueUtils = require("../_utils/vue-utils.js"); const useChildrenComponents = (name) => { const children = {}; const components = vue.ref([]); const getComponents = () => { if (children.value) { const _components = vueUtils.getComponentsFromChildren(children.value, name); if (_components.length !== components.value.length || _components.toString() !== components.value.toString()) { components.value = _components; } } }; vue.onMounted(() => getComponents()); vue.onUpdated(() => getComponents()); return { children, components }; }; exports.useChildrenComponents = useChildrenComponents;