1.3.29 • Published 6 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
6 years ago
1.3.28
6 years ago
1.3.27
6 years ago
1.3.26
6 years ago
1.3.25
6 years ago
1.3.22
6 years ago
1.3.21
6 years ago
1.3.20
6 years ago
1.3.2
6 years ago
1.3.13
6 years ago
1.2.13
6 years ago
1.2.12
6 years ago
1.2.11
6 years ago
1.2.9
6 years ago
1.2.8
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
6 years ago
1.0.3
6 years ago
1.0.2
6 years ago
1.0.1
6 years ago
1.0.0
6 years ago