You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
698 B
25 lines
698 B
import { shallowReactive } from 'vue';
|
|
|
|
const instances = shallowReactive([]);
|
|
const getInstance = (id) => {
|
|
const idx = instances.findIndex((instance) => instance.id === id);
|
|
const current = instances[idx];
|
|
let prev;
|
|
if (idx > 0) {
|
|
prev = instances[idx - 1];
|
|
}
|
|
return { current, prev };
|
|
};
|
|
const getLastOffset = (id) => {
|
|
const { prev } = getInstance(id);
|
|
if (!prev)
|
|
return 0;
|
|
return prev.vm.exposed.bottom.value;
|
|
};
|
|
const getOffsetOrSpace = (id, offset) => {
|
|
const idx = instances.findIndex((instance) => instance.id === id);
|
|
return idx > 0 ? 20 : offset;
|
|
};
|
|
|
|
export { getInstance, getLastOffset, getOffsetOrSpace, instances };
|
|
//# sourceMappingURL=instance.mjs.map
|
|
|