first commit
This commit is contained in:
20
node_modules/vant/es/composables/use-refs.mjs
generated
vendored
Normal file
20
node_modules/vant/es/composables/use-refs.mjs
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import { ref, onBeforeUpdate } from "vue";
|
||||
function useRefs() {
|
||||
const refs = ref([]);
|
||||
const cache = [];
|
||||
onBeforeUpdate(() => {
|
||||
refs.value = [];
|
||||
});
|
||||
const setRefs = (index) => {
|
||||
if (!cache[index]) {
|
||||
cache[index] = (el) => {
|
||||
refs.value[index] = el;
|
||||
};
|
||||
}
|
||||
return cache[index];
|
||||
};
|
||||
return [refs, setRefs];
|
||||
}
|
||||
export {
|
||||
useRefs
|
||||
};
|
||||
Reference in New Issue
Block a user