Vue.directive('my-directive', {
        bind: function () {},
        inserted: function () {},
        update: function () {},
        componentUpdated: function () {},
        unbind: function () {}
      })

      Javascript language logoGlobalDirective

      FrontendSnippets

      In the above code, Vue.directive contains the following properties: bind, inserted, update, componentUpdated, and unbind.

      bind: When this property is set to a function, Vue will call the function when the directive is initialized, when it is mounted, and when it is unmounted.

      inserted: When this property is set to a function, Vue will call the function when the directive is first inserted into the DOM.

      update: When this property is set to a function, Vue will call the function every time the directive's state is updated.

      componentUpdated: When this property is set to a function, Vue will call the function whenever a component that uses this directive is updated.

      unbind: This property allows you to unbind from events that the directive fires.

      Shortcut: global.directive

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.