【发布时间】:2022-01-27 07:53:18
【问题描述】:
我正在学习 Laravel 刀片。我已经安装了微风,我正在尝试在 dashboard.blade.php 中添加一个按钮。
<x-app-layout>
<x-slot name="header">
<h2 class="font-semibold text-xl text-gray-800 leading-tight">
{{ __('Dashboard') }}
</h2>
</x-slot>
<div class="py-12">
<div class="max-w-7xl mx-auto sm:px-6 lg:px-8">
<div class="bg-white overflow-hidden shadow-sm sm:rounded-lg">
<div class="p-6 bg-white border-b border-gray-200">
Hello, You're logged in!
<br><br><button type="button" class="btn btn-danger">Danger</button>
</div>
</div>
</div>
</div>
</x-app-layout>
按钮显示时没有任何形状或轮廓。你能告诉我我在这里犯了什么错误吗?
【问题讨论】:
-
tailwind 中没有
.btn和.btn-danger类。如果你想使用它,你应该看看 tailwind 文档:tailwindcss.com/docs/utility-first -
在顺风中,您可以将类似的东西用于类似的危险按钮:
rounded-md bg-red-500 text-white focus:ring-red-600 px-4 py-2 text-sm作为按钮类。我没有测试它,但它应该看起来不错 -
谢谢,我认为使用 bootstrap 比使用顺风功能更好
-
是的,但是看看这些类,您已经在使用 tailwind:
max-w-7xl mx-auto sm:px-6 lg:px-8。同时使用 Tailwind 和 Bootstrap 会很麻烦,它们只会互相取消
标签: laravel tailwind-css laravel-breeze