Package io.github.jeemv.springboot.vuejs
Class AbstractVueJS
java.lang.Object
io.github.jeemv.springboot.vuejs.AbstractVueJS
- Direct Known Subclasses:
VueComponent
,VueJS
AbstractVueJS This class is part of springBoot-VueJS
-
Field Summary
Modifier and TypeFieldDescriptionprotected VueComputeds
protected VueData
protected VueDirectives
protected VueFilters
protected VueMethods
protected VueWatchers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addComputed
(String name, String get) Adds a computed propertyvoid
addComputed
(String name, String get, String set) Adds an editable computed propertyvoid
Declare a datavoid
Adds a datavoid
addDataRaw
(String key, String value) Adds a data and the exact value without transformationvoid
addDeepWatcher
(String variableName, String... handlers) Adds a deep watcher on variableName, detect nested value changes inside Objects Handlers have oldVal and val as parametersaddDirective
(String name) Adds a new directive in the vue instanceaddDirective
(String name, String shortHand) Adds a new directive in the vue instanceAdds a new filter in the vue instanceprotected void
void
addImmediateWatcher
(String variableName, String... handlers) Adds an immediate watcher on variableName, the callback will be called immediately after the start of the observation Handlers have oldVal and val as parametersAdds a methodAdds a methodAdds a method with parametersvoid
addWatcher
(String variableName, boolean deep, boolean immediate, String... handlers) Adds a watcher on variableName Handlers have oldVal and val as parametersvoid
addWatcher
(String variableName, boolean deep, String... handlers) Adds a watcher on variableName Handlers have oldVal and val as parametersvoid
addWatcher
(String variableName, String... handlers) Adds a watcher on variableName Handlers have oldVal and val as parametersassignOriginal
(String originalData, String value) Assigns a value to an originalData cloned withcloneOriginalData
assignOriginalWithHttp
(String originalData) Assigns a value to an originalData cloned withcloneOriginalData
using Http response.datavoid
attachDeepWatcher
(String variableName, String methodName) Attaches an existing function for observing the variable, detect nested value changes inside Objects The function must have the prototype function (oldVal, val)void
attachImmediateWatcher
(String variableName, String methodName) Attaches an existing function for observing the variable, the callback will be called immediately after the start of the observation The function must have the prototype function (oldVal, val)void
attachWatcher
(String variableName, String methodName) Attaches an existing function for observing the variable The function must have the prototype function (oldVal, val)void
attachWatcher
(String variableName, String methodName, boolean deep) Attaches an existing function for observing the variable The function must have the prototype function (oldVal, val)void
attachWatcher
(String variableName, String methodName, boolean deep, boolean immediate) Attaches an existing function for observing the variable The function must have the prototype function (oldVal, val)cloneOriginalData
(String from, String dataTo) Clone an object and save the original object on this.dataTo.original To use withassignOriginal
Returns the data propertygetData()
getHooks()
abstract String
Returns the generated script creating the instancevoid
onBeforeCreate
(String body) Adds code (body) for the beforeCreate hookvoid
onBeforeDestroy
(String body) Adds code (body) for the beforeDestroy hookvoid
onBeforeMount
(String body) Adds code (body) for the beforeMount hookvoid
onBeforeUpdate
(String body) Adds code (body) for the beforeUpdate hookvoid
Adds code (body) for the created hookvoid
onDestroyed
(String body) Adds code (body) for the destroyed hookvoid
Adds code (body) for the mounted hookvoid
Adds code (body) for the updated hookvoid
onUpdatedNextTick
(String body) Adds code (body) for the updated hook wait until the entire view has been re-rendered with $nextTickSets a new value to a data in the vueJS instance.toString()
-
Field Details
-
data
-
methods
-
computed
-
watchers
-
directives
-
filters
-
hooks
-
-
Constructor Details
-
AbstractVueJS
public AbstractVueJS()
-
-
Method Details
-
addData
Adds a data- Parameters:
key
- the name of the datavalue
- the value
-
addDataRaw
Adds a data and the exact value without transformation- Parameters:
key
- the name of the datavalue
- the value
-
addData
Declare a data- Parameters:
key
- the name of the data
-
addMethod
Adds a method- Parameters:
name
- the method name- Returns:
- the method
-
addMethod
Adds a method- Parameters:
name
- the method namebody
- the method body (javascript)- Returns:
- the method
-
addMethod
Adds a method with parameters- Parameters:
name
- the method namebody
- the method body (javascript)params
- the method parameters- Returns:
- the method
-
addComputed
Adds an editable computed property- Parameters:
name
- the name of the computed propertyget
- body of the getterset
- body of the setter
-
addComputed
Adds a computed property- Parameters:
name
- the name of the computed propertyget
- body of the getter
-
attachWatcher
Attaches an existing function for observing the variable The function must have the prototype function (oldVal, val)- Parameters:
variableName
- the variable to observemethodName
- the method that observesdeep
- if true, detect nested value changes inside Objectsimmediate
- if true, the callback will be called immediately after the start of the observation
-
attachWatcher
Attaches an existing function for observing the variable The function must have the prototype function (oldVal, val)- Parameters:
variableName
- the variable to observemethodName
- the method that observesdeep
- if true, detect nested value changes inside Objects
-
attachWatcher
Attaches an existing function for observing the variable The function must have the prototype function (oldVal, val)- Parameters:
variableName
- the variable to observemethodName
- the method that observes
-
attachImmediateWatcher
Attaches an existing function for observing the variable, the callback will be called immediately after the start of the observation The function must have the prototype function (oldVal, val)- Parameters:
variableName
- the variable to observemethodName
- the method that observes
-
attachDeepWatcher
Attaches an existing function for observing the variable, detect nested value changes inside Objects The function must have the prototype function (oldVal, val)- Parameters:
variableName
- the variable to observemethodName
- the method that observes
-
addWatcher
Adds a watcher on variableName Handlers have oldVal and val as parameters- Parameters:
variableName
- the variable to observedeep
- if true, detect nested value changes inside Objectsimmediate
- if true, the callback will be called immediately after the start of the observationhandlers
- the bodies of the methods that observe
-
addWatcher
Adds a watcher on variableName Handlers have oldVal and val as parameters- Parameters:
variableName
- the variable to observedeep
- if true, detect nested value changes inside Objectshandlers
- the bodies of the methods that observe
-
addWatcher
Adds a watcher on variableName Handlers have oldVal and val as parameters- Parameters:
variableName
- the variable to observehandlers
- the bodies of the methods that observe
-
addImmediateWatcher
Adds an immediate watcher on variableName, the callback will be called immediately after the start of the observation Handlers have oldVal and val as parameters- Parameters:
variableName
- the variable to observehandlers
- the bodies of the methods that observe
-
addDeepWatcher
Adds a deep watcher on variableName, detect nested value changes inside Objects Handlers have oldVal and val as parameters- Parameters:
variableName
- the variable to observehandlers
- the bodies of the methods that observe
-
addHook
-
addDirective
Adds a new directive in the vue instance- Parameters:
name
- The directive name- Returns:
- The created directive
-
addDirective
Adds a new directive in the vue instance- Parameters:
name
- The directive nameshortHand
- Shorthand function for bind and update- Returns:
- The created directive
-
addFilter
Adds a new filter in the vue instance- Parameters:
name
- The filter namebody
- The method bodyargs
- The filter arguments- Returns:
- The created filter
-
onBeforeCreate
Adds code (body) for the beforeCreate hook- Parameters:
body
- the code to execute
-
onCreated
Adds code (body) for the created hook- Parameters:
body
- the code to execute
-
onBeforeMount
Adds code (body) for the beforeMount hook- Parameters:
body
- the code to execute
-
onMounted
Adds code (body) for the mounted hook- Parameters:
body
- the code to execute
-
onBeforeUpdate
Adds code (body) for the beforeUpdate hook- Parameters:
body
- the code to execute
-
onUpdated
Adds code (body) for the updated hook- Parameters:
body
- the code to execute
-
onUpdatedNextTick
Adds code (body) for the updated hook wait until the entire view has been re-rendered with $nextTick- Parameters:
body
- the code to execute
-
onBeforeDestroy
Adds code (body) for the beforeDestroy hook- Parameters:
body
- the code to execute
-
onDestroyed
Adds code (body) for the destroyed hook- Parameters:
body
- the code to execute
-
getHooks
-
set
Sets a new value to a data in the vueJS instance.- Parameters:
data
- a data declared with addData methodvalue
- The value to be set- Returns:
- the generated script (javascript)
-
get
Returns the data property- Parameters:
data
- the data name- Returns:
- the generated script (javascript)
-
cloneOriginalData
Clone an object and save the original object on this.dataTo.original To use withassignOriginal
- Parameters:
from
- The object to clonedataTo
- a data in vueJS instance- Returns:
- the generated script (javascript)
-
assignOriginal
Assigns a value to an originalData cloned withcloneOriginalData
- Parameters:
originalData
- data declared on the vueJS instancevalue
- the value to assign to this.originalData- Returns:
- the generated script (javascript)
-
assignOriginalWithHttp
Assigns a value to an originalData cloned withcloneOriginalData
using Http response.data- Parameters:
originalData
- data declared on the vueJS instance- Returns:
- the generated script (javascript)
-
getScript
Returns the generated script creating the instance- Returns:
- the generated script (javascript)
-
getData
-
getMethods
-
getComputed
-
getDirectives
-
toString
-
getWatchers
-
getFilters
-