@opentiny/vue-renderless
Version:
An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
29 lines (28 loc) • 811 B
JavaScript
import "../chunk-G2ADBYYC.js";
const queryChange = ({ select, state, vm }) => () => {
state.visible = true;
if (Array.isArray(select.state.options)) {
const groupOptions = select.state.options.filter((option) => {
return option.state.parent.$parent && vm && option.state.parent.$parent.label === vm.label;
});
if (Array.isArray(groupOptions)) {
state.visible = groupOptions.some((option) => option.visible === true);
}
}
};
const observeCallback = ({ state, api }) => (mutationsList) => {
for (let mutation of mutationsList) {
if (mutation.type === "childList") {
if (state.timer) {
clearTimeout(state.timer);
}
state.timer = setTimeout(() => {
api.queryChange();
}, 100);
}
}
};
export {
observeCallback,
queryChange
};