Actions
Actions in cbwire are methods in your cbwire component that are invoked when user interactions occur. Once an action has been invoked, the component's template is re-rendered.
1
// File: ./wires/Counter.cfc
2
component extends="cbwire.model.Component"{
3
4
// Data property
5
variables.data = {
6
"counter": 0
7
};
8
9
// Action
10
function increment(){
11
variables.data.counter += 1;
12
}
13
}
Copied!
1
<div>
2
<button wire:click="increment">Increment Counter</button>
3
</div>
Copied!
Last modified 2mo ago
Copy link
Edit on GitHub