Laravel LiveWire模型集默认值
我有一个通过迭代循环生成的桌子。问题在于类型日期的输入字段。当我尝试附加LiveWire模型时,它不会显示来自数据库的值。
<input wire:model.defer="DurationTo" class="form-control form-control-solid ps-12" placeholder="Select a date" name="duration_to" type="date"
value="{{ $table->duration_to->format('Y-m-d') }}"/>
如果我删除
wire:model.defer="DurationTo"
,则它开始显示默认值,否则显示为空。但是,如果我删除绑定,那么显然我将在模型中没有任何更新。请指导什么是更好的方法
I have a table that I am generating through an iterative loop. The issue is that there is an input field of type date. When I try to attach my livewire model, it doesn't show the value coming from the database.
<input wire:model.defer="DurationTo" class="form-control form-control-solid ps-12" placeholder="Select a date" name="duration_to" type="date"
value="{{ $table->duration_to->format('Y-m-d') }}"/>
If I remove
wire:model.defer="DurationTo"
Then it start showing the default value otherwise it show empty. But if I remove binding then obviously I will get nothing in the model to update. Kindly guide what is the better way of doing this
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论