first commit
This commit is contained in:
13
node_modules/vant/es/composables/use-id.mjs
generated
vendored
Normal file
13
node_modules/vant/es/composables/use-id.mjs
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import { getCurrentInstance } from "vue";
|
||||
let current = 0;
|
||||
function useId() {
|
||||
const vm = getCurrentInstance();
|
||||
const { name = "unknown" } = (vm == null ? void 0 : vm.type) || {};
|
||||
if (process.env.NODE_ENV === "test") {
|
||||
return name;
|
||||
}
|
||||
return `${name}-${++current}`;
|
||||
}
|
||||
export {
|
||||
useId
|
||||
};
|
||||
Reference in New Issue
Block a user