Package io.github.jeemv.springboot.vuejs
Class VueJS
java.lang.Object
io.github.jeemv.springboot.vuejs.AbstractVueJS
io.github.jeemv.springboot.vuejs.VueJS
VueJS instance This class is part of springBoot-VueJS
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected String[]
protected String
protected Map<String,
VueComponent> protected Map<String,
AbstractVueComposition> protected boolean
protected VueJSAutoConfiguration
protected boolean
protected String
Fields inherited from class io.github.jeemv.springboot.vuejs.AbstractVueJS
computed, data, directives, filters, hooks, methods, watchers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addBeforeMountScript
(String script) Adds a script to be executed before the VueJS instance is mounted.addGlobalComponent
(String name) Adds a new global component.addGlobalDirective
(String name) Adds a new global directive.addGlobalFilter
(String name, String body, String... args) Adds a new global filter.String[]
getEl()
Returns the generated script creating the VueJS instance.protected VueVersion
getVueVersion
(String globalScript) void
init()
boolean
isVue2()
boolean
void
loadAndAddBeforeMountScript
(String filename) Loads a script from a file and adds it to the before mount script.void
setDelimiters
(String start, String end) Defines the element delimiters (<% %>).void
void
setUseAxios
(boolean useAxios) Sets axios as library to use for $http do not forget to include the corresponding js file.Methods inherited from class io.github.jeemv.springboot.vuejs.AbstractVueJS
addComputed, addComputed, addData, addData, addDataRaw, addDeepWatcher, addDirective, addDirective, addFilter, addHook, addImmediateWatcher, addMethod, addMethod, addMethod, addWatcher, addWatcher, addWatcher, assignOriginal, assignOriginalWithHttp, attachDeepWatcher, attachImmediateWatcher, attachWatcher, attachWatcher, attachWatcher, cloneOriginalData, get, getComputed, getData, getDirectives, getFilters, getHooks, getMethods, getWatchers, onBeforeCreate, onBeforeDestroy, onBeforeMount, onBeforeUpdate, onCreated, onDestroyed, onMounted, onUpdated, onUpdatedNextTick, set, toString
-
Field Details
-
el
-
delimiters
-
useAxios
protected boolean useAxios -
vuetify
protected boolean vuetify -
vueVersion
-
beforeMountScript
-
globalComponents
-
globalElements
-
vueJSAutoConfiguration
-
-
Constructor Details
-
VueJS
- Parameters:
element
- the DOM selector for the VueJS application.
-
VueJS
public VueJS()Starts the VueJS app with v-app element.
-
-
Method Details
-
getVueVersion
-
init
@PostConstruct public void init() -
setDelimiters
Defines the element delimiters (<% %>).- Parameters:
start
- default: <%end
- default: %>
-
getScript
Returns the generated script creating the VueJS instance.- Specified by:
getScript
in classAbstractVueJS
- Returns:
- the generated script (javascript)
-
addGlobalComponent
Adds a new global component.- Parameters:
name
- The component name- Returns:
- The created component
-
addGlobalDirective
Adds a new global directive.- Parameters:
name
- The directive name- Returns:
- The created directive
-
addGlobalFilter
Adds a new global filter.- Parameters:
name
- The filter namebody
- The filter bodyargs
- The filter arguments- Returns:
- The created filter
-
getEl
-
getDelimiters
-
setEl
-
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
Adds a script to be executed before the VueJS instance is mounted.- Parameters:
script
-
-
loadAndAddBeforeMountScript
Loads a script from a file and adds it to the before mount script.- Parameters:
filename
-- Throws:
IOException
-