Class VueDirective

java.lang.Object
io.github.jeemv.springboot.vuejs.parts.AbstractVueComposition
io.github.jeemv.springboot.vuejs.parts.VueDirective

public class VueDirective extends AbstractVueComposition
VueDirective This class is part of springBoot-VueJS
  • Field Details

  • Constructor Details

    • VueDirective

      public VueDirective()
    • VueDirective

      public VueDirective(String name)
      Parameters:
      name - The directive name (ex: demo for v-demo directive)
    • VueDirective

      public VueDirective(String name, String shortHand)
      Parameters:
      name - The directive name
      shortHand - Same behavior on bind and update, but don’t care about the other hooks
  • Method Details

    • setShortHand

      public void setShortHand(String shortHand)
    • onBind

      public VueDirective onBind(String body)
      called only once, when the directive is first bound to the element. This is where you can do one-time setup work. arguments of the method are el, binding and vnode
      Parameters:
      body - The javascript code associated
      Returns:
      the directive
    • onUpdate

      public VueDirective onUpdate(String body)
      called after the containing component’s VNode has updated, but possibly before its children have updated. arguments of the method are el, binding, vnode and oldVnode
      Parameters:
      body - The javascript code associated
      Returns:
      The directive
    • onComponentUpdated

      public VueDirective onComponentUpdated(String body)
      called after the containing component’s VNode and the VNodes of its children have updated. arguments of the method are el, binding, vnode and oldVnode
      Parameters:
      body - The javascript code associated
      Returns:
      The directive
    • onInserted

      public VueDirective onInserted(String body)
      called when the bound element has been inserted into its parent node (this only guarantees parent node presence, not necessarily in-document). arguments of the method are el, binding and vnode
      Parameters:
      body - The javascript code associated
      Returns:
      The directive
    • onUnbind

      public VueDirective onUnbind(String body)
      called only once, when the directive is unbound from the element. arguments of the method are el, binding and vnode
      Parameters:
      body - The javascript code associated
      Returns:
      The directive
    • on

      protected VueDirective on(String event, String body)
      Adds an event in the directive
      Parameters:
      event - The associated event
      body - The javascript code associated
      Returns:
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getType

      public String getType()
      Specified by:
      getType in class AbstractVueComposition
    • setDeep

      public void setDeep()
      To also detect nested value changes inside Objects