Vue.elementDirective()

Vue.elementDirective( id, [definition] )

  • Arguments:

    • {String} id
    • {Object} [definition]
  • Usage:

    Register or retrieve a global element directive.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    // register
    Vue.elementDirective('my-element', {
      bind: function () {},
      // element directives do not use `update`
      unbind: function () {}
    })
     
    // getter, return the directive definition if registered
    var myDirective = Vue.elementDirective('my-element')
  • See also: Element Directives

doc_VueJS
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.