How to use the @vue/composition-api.provide function in @vue/composition-api

To help you get started, we’ve selected a few @vue/composition-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PECE-project / drupal-pece / src / front / components / ui / Modal.vue View on Github external
setup ({ scrollable }, { emit }) {
    provide('onClose', onClose)

    function onClose () {
      emit('onClose')
    }

    function escFullScreen (e) {
      if (e.key === 'Escape') {
        onClose()
      }
    }

    function toggleOverflow (overflow) {
      if (scrollable) { return }
      document.body.style.overflow = overflow
    }
github PECE-project / drupal-pece / src / front / components / ui / FormControlValidate.vue View on Github external
setup ({ rules }) {
    if (rules.includes('required')) {
      provide('required', true)
    }
  }
}
github LinusBorg / composition-api-demos / src / store / index.js View on Github external
setup() {
    provide(key, {
      ...toRefs(readonly(state)),
      ...computeds,
      ...actions,
    })
    return {}
  },
  render(h) {
github LinusBorg / composition-api-demos / src / composables / use-global-dnd.js View on Github external
export default function useGlobalFileDnD(enableProvide = false) {
  const { events, hovering: dragging, cancel } = useFileDnD()

  const html = document.querySelector('html')

  eventNames.forEach(evt => {
    useEvent(html, evt, events[evt])
  })
  useEvent(html, 'dragend', cancel)

  enableProvide &&
    provide(enableProvide !== true ? enableProvide : key, dragging)

  return dragging
}