jpmurray / gonewiththewind
包含Tailwind CSS组件的包,与默认的Laravel Tailwind UI兼容良好。
1.3.2
2021-01-02 18:52 UTC
Requires
- laravel/framework: ^8.12
README
提供(我认为是)blade组件的包,这些组件与Laravel提供的(例如Breeze中的)基本Tailwind UI兼容良好。
这是为了尝试学习Tailwind。请注意,我并不是真的想学习它,我仍然希望直接使用Bootstrap!但我是一个原型设计师,我似乎不得不在我安排的时间中抽出一点时间,以便我可以随Laravel现在提供的默认设置“随风而去”。
组件和用法
卡片组件
表格
<x-with-wind-cards::table model="user" :data="$users" :show="['name']" :actions="['edit']" />
属性:
model
要求传入单个模型名称以生成路由等(例如:`route('users.index')`)data
要求传入要显示在表格中的数据,与eloquent集合或分页集合配合良好。show
要求显示数据中的哪些列(例如:`['name', 'created_at']`)actions
默认为null,但如果提供,将添加一个带有指定操作的action
列。目前支持['edit', 'delete']
表单组件
标签
<x-with-wind-forms::label for="name">Name</<x-with-wind-forms::label>
输入
<x-with-wind-forms::input id="name" type="text" name="name" :value="old('name')" required />
选择
<x-with-wind-forms::select id="type" name="type" autocomplete="type" :choices="['Label' => 'value']" chosen="value" />
属性:
choices
要求传入一个关联数组,用于填充选择元素(`label => value`)chosen
要求在必要时选择哪个选项。
提交按钮
<x-with-wind-forms::submit>Save</<x-with-wind-forms::submit>