@varlet/ui
Version:
A Vue3 component library based on Material Design 2 and 3, supporting mobile and desktop.
20 lines (19 loc) • 407 B
JavaScript
import { ref, watch } from "vue";
import context from "./index.mjs";
function useZIndex(source, count) {
const zIndex = ref(context.zIndex);
watch(
source,
(newValue) => {
if (newValue) {
context.zIndex += process.env.NODE_ENV === "test" ? 0 : count;
zIndex.value = context.zIndex;
}
},
{ immediate: true }
);
return { zIndex };
}
export {
useZIndex
};