Class VueJS


@Component public class VueJS extends AbstractVueJS
VueJS instance This class is part of springBoot-VueJS
  • Field Details

    • el

      protected String el
    • delimiters

      protected String[] delimiters
    • useAxios

      protected boolean useAxios
    • vuetify

      protected boolean vuetify
    • vueVersion

      protected String vueVersion
    • beforeMountScript

      protected String beforeMountScript
    • globalComponents

      protected Map<String,VueComponent> globalComponents
    • globalElements

      protected Map<String,AbstractVueComposition> globalElements
    • vueJSAutoConfiguration

      @Autowired(required=false) protected VueJSAutoConfiguration vueJSAutoConfiguration
  • Constructor Details

    • VueJS

      public VueJS(String element)
      Parameters:
      element - the DOM selector for the VueJS application.
    • VueJS

      public VueJS()
      Starts the VueJS app with v-app element.
  • Method Details

    • getVueVersion

      protected VueVersion getVueVersion(String globalScript)
    • init

      @PostConstruct public void init()
    • setDelimiters

      public void setDelimiters(String start, String end)
      Defines the element delimiters (<% %>).
      Parameters:
      start - default: <%
      end - default: %>
    • getScript

      public String getScript()
      Returns the generated script creating the VueJS instance.
      Specified by:
      getScript in class AbstractVueJS
      Returns:
      the generated script (javascript)
    • addGlobalComponent

      public VueComponent addGlobalComponent(String name)
      Adds a new global component.
      Parameters:
      name - The component name
      Returns:
      The created component
    • addGlobalDirective

      public VueDirective addGlobalDirective(String name)
      Adds a new global directive.
      Parameters:
      name - The directive name
      Returns:
      The created directive
    • addGlobalFilter

      public VueFilter addGlobalFilter(String name, String body, String... args)
      Adds a new global filter.
      Parameters:
      name - The filter name
      body - The filter body
      args - The filter arguments
      Returns:
      The created filter
    • getEl

      public String getEl()
    • getDelimiters

      public String[] getDelimiters()
    • setEl

      public void setEl(String el)
    • setUseAxios

      public void setUseAxios(boolean useAxios)
      Sets axios as library to use for $http do not forget to include the corresponding js file.
      Parameters:
      useAxios -
    • isVuetify

      public boolean isVuetify()
    • isVue2

      public boolean isVue2()
    • addBeforeMountScript

      public void addBeforeMountScript(String script)
      Adds a script to be executed before the VueJS instance is mounted.
      Parameters:
      script -
    • loadAndAddBeforeMountScript

      public void loadAndAddBeforeMountScript(String filename) throws IOException
      Loads a script from a file and adds it to the before mount script.
      Parameters:
      filename -
      Throws:
      IOException