1.1.12 • Published 3 years ago
crushed v1.1.12
crush.js
install
npm install crushedexample
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
3 years ago
1.1.11
3 years ago
1.1.10
3 years ago
1.1.1
3 years ago
1.1.9
3 years ago
1.1.8
3 years ago
1.1.7
3 years ago
1.1.6
3 years ago
1.1.5
3 years ago
1.1.4
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.0.16
4 years ago
1.0.11
4 years ago
1.0.15
4 years ago
1.0.14
4 years ago
1.0.13
4 years ago
1.0.12
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.10
4 years ago
1.0.0
4 years ago