php-junior/nova-quick-view

Laravel Nova 快速查看。

v1.0.0 2020-12-09 04:05 UTC

This package is auto-updated.

Last update: 2024-09-23 09:08:03 UTC


README

Latest Stable Version Total Downloads

screenshot 1 screenshot 2 screenshot 3

安装

您可以通过 composer 将此包安装到使用 Nova 的 Laravel 应用中

composer require php-junior/nova-quick-view

使用方法

添加以下代码

public function fields(Request $request)
{
    return [
        ...
        NovaQuickView::make('Hello', function () {
            return '<p>Hi, there!</p>';
        })
        ->icon('el-icon-search')
        ->title('I am the title')
        ->direction('rtl') rtl / ltr / ttb / btt
        ...
    ];
}

如果您需要渲染 HTML 内容

public function fields(Request $request)
{
    return [
        ...
        NovaQuickView::make('Hello', function () {
            return view('partials.hello', [
                'text' => 'Hi, there!'
            ])->render();
        })
        ->icon('el-icon-search')
        ->title('I am the title')
        ->direction('rtl') // rtl / ltr / ttb / btt
        ...
    ];
}

请从 element 检查图标列表。如果您想使用 fontawesome 或其他,请在 layout.blade.php 中导入 CSS 文件

致谢

  • 所有贡献者

许可

MIT 许可证 (MIT)。更多信息请参阅 许可文件