English 中文(简体)
• 如何通过活线行动,穿过字面的国际发展参数?
原标题:How in livewire action to path ID parameter which has string literals?

在Rravel 10 / Livewire, I got差错

livewire.js?id=44144c23:1123 Alpine Expression Error: Unexpected token  > 
Expression: "$wire.markAsRead($notification->id)"

点击纽顿,通知编号为ID参数:

wire:click="markAsRead($notification->id)

在通知方面提出的假设不是惯性价值,而是也证明。

我试图用“:

wire:click="markAsRead( $notification->id )"

但从这个字面上看,已经过去了:

$notification->id

我如何通过参数?

问题回答

电话:click由浏览器方执行,因此,参数值必须用{>>让联合材料从后方印成:

wire:click="markAsRead({{ $notification->id }})"

{{-- or with quotes if you need a string --}}
wire:click="markAsRead( {{ $notification->id }} )"




相关问题
Table of calificacions in php and laravel

I created a table in order to show the name of the students, name of the subjects and the grade of the subject of the student I have the next code: this is the index part <form action="{{ ...

How to fix CORS for Capacitor/Quasar App in a Laravel API

I have an App built on top of Quasar and Capacitor, with an API built on top of Laravel. Everything works well on the dev environment until I build and install the app on my phone, then I keep getting ...

Laravel +Vuejs CORS issue

I am facing a dilemma wit the CORS issue. I have application that is configured as follow: API: https://abc.mydomain.com (laravel) front end: https://subdomain.mydomain.com(VueJS) Both applications ...

Laravel wrong redirecting to login page after login

In a multi tenancy with subdomain enviroment (http://zapburger.dex.local) when user fills login form with valid data and make login, laravel redirect to dashboard route (as expected) and then redirect ...

热门标签