Events
Dispatching Events
// ./wires/Posts.bx
class extends="cbwire.models.Component" {
function addPost() {
dispatch( "post-added" );
}
}// ./wires/Posts.cfc
component extends="cbwire.models.Component" {
function addPost() {
dispatch( "post-added" );
}
}<!--- ./wires/posts.bxm|cfm --->
<div>
<button wire:click="$dispatch( 'post-added' )">Add Post</button>
</div><!--- ./wires/posts.bxm|cfm --->
<script>
Livewire.dispatch( 'post-added' );
</script>Passing Parameters
dispatchTo
dispatchSelf
Listeners
Dispatching Browser Events
Was this helpful?