What's New in DativeJs
DativeJs has released a new version recently v2-alpha.1
What does it bring
DativeJs has added new feautures like
- animations
- helpers
Some global methods has been deprecated like
-
Dative.importstyle(href: string)use the normal<link>now -
Dative.use(plugin, ...opts)useapp.use
Some options has been deprecated,changed
-
updatehas been deprecated -
mountedhas been changed toonmounted -
createdhas been changed tooncreated
New Options has added
-
animatefor defining animations -
usefor installing a plugin -
propertyfor creating a local property -
attachfor attaching a Dative Component/Instance to another Dative Instance
New Global Methods added
-
defineAppThis is a shorter way of creating a dative instance. No Need Fornewkeyword with the defineApp methods
import { defineApp } from 'dativejs'
var app = defineApp({
el: "#app" // or a css selector or a tag
})
-
definePropertyIt's used to create property in DativeJs see defineProperty in DativeJs Docs
import { defineProperty } from 'dativejs'
defineProperty('foo',()=>{
return 'bar'
})
-
extendIt's used to extend Dative Instance in DativeJs see extend in DativeJs Docs
import Dative from 'dativejs'
export let SideBar = Dative.extend({
// same options with the dative option but no el options
})
// index.js
import { SideBar } from './sidebar.dative.js'
new SideBar({
el: "#sidebar"
})
The new way of installing a plugin in Dative.Js is quiet more easy

Top comments (0)