Welcome to mirror list, hosted at ThFree Co, Russian Federation.

get_instance_from_directive.js « vue3compat « utils « lib « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b69f5e0c5467868d93466e0030bf1ea8eb6408a1 (plain)
1
2
3
4
5
6
7
8
9
// See https://v3-migration.vuejs.org/breaking-changes/custom-directives.html#edge-case-accessing-the-component-instance
export function getInstanceFromDirective({ binding, vnode }) {
  if (binding.instance) {
    // this is Vue.js 3, even in compat mode
    return binding.instance;
  }

  return vnode.context;
}