1.3.29 • Published 7 years ago
sitekit-extensions v1.3.29
Sitekit extensions
Installation
If using yarn type:
yarn add sitekit-extensions
If using npm type:
npm i sitekit-extensions -add
Usage
To begin usage just import the extensions you want to use and add them into your widgets use: []
property
An example of using the reactive and knockout widgets:
import { reactive, mousemove } from 'sitekit-extensions'
export default function (Site, $){
Site.widget('mousepos', {
use: [
reactive(),
mousemove(),
]
onMousemove({x, y}){
this.setState({
pos: {x, y}
})
}
react(){
this.changed('pos', (prevState, newState, self) => {
this.element.toggleClass('right', this.state.x > window.innerWidth / 2)
})
/* or use no namespace to react to all props */
this.changed((prevState, newState, self) => {
this.element.toggleClass('left', this.state.x < window.innerWidth / 2)
})
}
})
}
1.3.29
7 years ago
1.3.28
7 years ago
1.3.27
7 years ago
1.3.26
7 years ago
1.3.25
7 years ago
1.3.22
7 years ago
1.3.21
7 years ago
1.3.20
7 years ago
1.3.2
7 years ago
1.3.13
7 years ago
1.2.13
7 years ago
1.2.12
7 years ago
1.2.11
7 years ago
1.2.9
7 years ago
1.2.8
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago