Skip to content

Commit

Permalink
Event Render Hook example: eventDidMount should return string
Browse files Browse the repository at this point in the history
  • Loading branch information
cawecoy committed Mar 28, 2024
1 parent 016fd8d commit 6568dfa
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ If you want to customize the calendar's event rendering, you can use Fullcalenda

Here's an example of how you can use the `eventDidMount` hook to add a custom implementation:
```php
public function eventDidMount() {
public function eventDidMount(): string
{
return <<<JS
function({ event, timeText, isStart, isEnd, isMirror, isPast, isFuture, isToday, el, view }){
// Write your custom implementation here
Expand Down Expand Up @@ -484,7 +485,8 @@ protected function headerActions(): array
You can add a tooltip to fully show the event title when the user hovers over the event via JavaScript on the `eventDidMount` method:

```php
public function eventDidMount() {
public function eventDidMount(): string
{
return <<<JS
function({ event, timeText, isStart, isEnd, isMirror, isPast, isFuture, isToday, el, view }){
el.setAttribute("x-tooltip", "tooltip");
Expand Down

0 comments on commit 6568dfa

Please sign in to comment.