UNPKG

song-ui-u

Version:

vue3 + js的PC前端组件库

20 lines (17 loc) 582 B
import { shallowReactive } from 'vue'; const messageInstances = shallowReactive([]); const getInstance = (id) => { const index = messageInstances.findIndex((item) => item.id === id); const current = messageInstances[index]; let prev = index > 0 ? messageInstances[index - 1] : null; return { current, prev }; }; const getPrevBottomOffset = (id) => { const { prev } = getInstance(id); if (!prev) { return 0; } return prev.vm?.exposed?.bottomPosition.value; }; export { getInstance, getPrevBottomOffset, messageInstances }; //# sourceMappingURL=instance.mjs.map