Class VueComponent
java.lang.Object
io.github.jeemv.springboot.vuejs.AbstractVueJS
io.github.jeemv.springboot.vuejs.components.VueComponent
VueJS component class
This class is part of springBoot-VueJS
Components are created in src/main/resources/static/
-
Field Summary
Fields inherited from class io.github.jeemv.springboot.vuejs.AbstractVueJS
computed, data, directives, filters, hooks, methods, watchers
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a new property to the componentAdds a required property to the componentAdds a mutable property (use mutProperty=value to assign a value)addPropRaw
(String name, String defaultValue) Adds a new property to the component defaultValue is not quoted (because it's a raw property)void
createFile
(boolean minify) void
createFile
(String pathFilename, boolean minify) Generates a new VueJS component and save it to a filegetName()
getProps()
Returns the generated script creating the instancestatic void
globalJs()
static void
boolean
protected void
loadTemplateFile
(String filename) Sets the default template file (componentName+".html")void
setInternal
(boolean internal) Defines if the component is created in the vue instance or notSets the component propertiessetTemplate
(String template) Defines the template stringsetTemplateFile
(String pathFilename) Sets a template fileMethods 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
-
Constructor Details
-
VueComponent
public VueComponent() -
VueComponent
-
VueComponent
-
-
Method Details
-
getScript
Description copied from class:AbstractVueJS
Returns the generated script creating the instance- Specified by:
getScript
in classAbstractVueJS
- Returns:
- the generated script (javascript)
-
getName
-
getTemplate
-
setTemplate
Defines the template string- Parameters:
template
-- Returns:
- VueComponent
-
setTemplateFile
Sets a template file- Parameters:
pathFilename
-- Returns:
- VueComponent
-
setDefaultTemplateFile
Sets the default template file (componentName+".html") -
isInternal
public boolean isInternal() -
setInternal
public void setInternal(boolean internal) Defines if the component is created in the vue instance or not- Parameters:
internal
-
-
getProps
-
setProps
Sets the component properties- Parameters:
props
-- Returns:
- VueComponent
-
addProp
Adds a new property to the component- Parameters:
name
- The property namedefaultValue
- The property default value- Returns:
-
addPropRaw
Adds a new property to the component defaultValue is not quoted (because it's a raw property)- Parameters:
name
- The property namedefaultValue
- non quoted value- Returns:
-
addProp
Adds a required property to the component- Parameters:
name
- The property nametype
- The property typerequired
- true if the property is required- Returns:
-
addProp
Adds a mutable property (use mutProperty=value to assign a value)- Parameters:
name
- then name of the propertytype
- the property type (Object,Array,Function,String,Number,Boolean)required
- if true property is requiredmutable
- if true property is mutable- Returns:
- the property added
-
loadTemplateFile
- Throws:
IOException
-
createFile
Generates a new VueJS component and save it to a file- Parameters:
pathFilename
- the path file name (from static folder)minify
- if true minify the javascript source code- Throws:
IOException
- for file creation
-
createFile
- Throws:
IOException
-
globalJs
public static void globalJs() -
globalJs
- Throws:
IOException
-