1.1.12 • Published 2 years ago
crushed v1.1.12
crush.js
install
npm install crushed
example
a simple counter example
import { createApp , useRefState } from 'crushed'
let counter = {
template: `
<style>
h1{
$color:rgb(count*10,count*10,count*10);
$background-color:rgb(255-count*10,255-count*10,255-count*10);
}
</style>
<button @click="setCount(count + 1)"> + </button>
<button @click="setCount(count - 1)"> - </button>
<h1> count : {{count}} </h1>
`,
create() {
// one line code for declare state, set state , watch state
const { count, setCount, onCountChange } = useRefState(0)
onCountChange(() => {
console.log('count change !')
})
}
}
let app = createApp(counter).mount('#app')
1.1.12
2 years ago
1.1.11
2 years ago
1.1.10
2 years ago
1.1.1
2 years ago
1.1.9
2 years ago
1.1.8
2 years ago
1.1.7
2 years ago
1.1.6
2 years ago
1.1.5
2 years ago
1.1.4
2 years ago
1.1.3
2 years ago
1.1.2
2 years ago
1.0.16
2 years ago
1.0.11
2 years ago
1.0.15
2 years ago
1.0.14
2 years ago
1.0.13
2 years ago
1.0.12
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.0.6
2 years ago
1.0.5
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
1.0.10
2 years ago
1.0.0
3 years ago