The el or target is the target for the application
var mv = new Dative ( {
el : "#app"
} )
// Or
var mv = new Dative ( {
target : "#app"
} )
The data can be either a function or an object
var mv = new Dative ( {
el : "#app" ,
data : {
name : "Dative"
}
} )
//Or
var mv = new Dative ( {
el : "#app" ,
data : function ( ) {
return {
name : "Dative"
}
}
} )
// or
var mv = new Dative ( {
el : "#app" ,
data :( ) => ( {
name : "Dative"
} )
} )
The methods is the event listeners for the application
< script type ="text/dative ">
< h1 > { { name } } </ h1 >
< button on :click = "change" > Change < / b u t t o n >
</ script >
var mv = new Dative ( {
el : "#app" ,
data : function ( ) {
return {
name : "Dative"
}
} ,
methods :{
change ( ) {
this . data . name += " A Micro Ui Framework"
}
}
} )
mv . render ( )
The Mounted function is a function thats been used when the application has mounted
var mv = new Dative ( {
el : "#app" ,
data : function ( ) {
return {
name : "wow"
}
} ,
mounted ( ) {
this . data . name = "DativeJs is A Micro Ui Framework"
}
} )
mv . render ( )
The Created function is a function thats been used when the application has been created
var mv = new Dative ( {
el : "#app" ,
data : function ( ) {
return {
name : "wow"
}
} ,
created ( ) {
this . data . name = "DativeJs is A Micro Ui Framework"
}
} )
mv . render ( )
The Update function is a function thats been used when the application has updated
var mv = new Dative ( {
el : "#app" ,
data : function ( ) {
return {
name : "wow"
}
} ,
update ( ) {
console . log ( "yes it has updated" )
}
} )
mv . render ( )