StickyContext.js 362 B

1234567891011
  1. import isStyleSupport from '../../_util/styleChecker';
  2. import { onMounted, shallowRef } from 'vue';
  3. const supportSticky = shallowRef(false);
  4. export const useProvideSticky = () => {
  5. onMounted(() => {
  6. supportSticky.value = supportSticky.value || isStyleSupport('position', 'sticky');
  7. });
  8. };
  9. export const useInjectSticky = () => {
  10. return supportSticky;
  11. };