【发布时间】:2021-06-19 20:29:33
【问题描述】:
我似乎在 laravel livewire 和 alpine JS 方面遇到了问题。我目前创建了一个日期时间选择器(使用 Tailwind CSS 和 AlpineJS),并且以某种方式选定的日期值不会传输到其公共线:模型(refDate)变量,因此它始终为空且为空。这是前端代码的sn-p。
<input type="hidden" name="date" x-ref="date">
<input wire:model="refDate" id="reference_date" type="text" x-model="datepickerValue" @click="showDatepicker = !showDatepicker" @keydown.escape="showDatepicker = false" class="w-full border border-gray-300 rounded-md text-gray-600 h-10 bg-white hover:border-gray-400 focus:outline-none appearance-none" placeholder="Select date">
我的 datetimepicker 使用了 tailwindcss 中的一个现有组件 (https://tailwindcomponents.com/component/datepicker-with-tailwindcss-and-alpinejs) 让我知道您的想法以及将其链接到 livewire 模型的可能解决方案。谢谢。
【问题讨论】:
标签: php laravel laravel-livewire alpine.js