smarteknoloji/blade-circle-flags

一个易于在 Laravel Blade 视图中使用 Circle Flags 的包。

1.0.1 2024-09-22 18:22 UTC

This package is auto-updated.

Last update: 2024-09-22 18:25:33 UTC


README

Blade Circle Flags

Tests Latest Stable Version Total Downloads

一个易于在 Laravel Blade 视图中使用 circle-flags 的包。

要查看所有可用的图标,请参阅 SVG 目录 或在 https://hatscripts.github.io/circle-flags/ 预览。

要求

  • PHP 8.1 或更高版本
  • Laravel 10.0 或更高版本

安装

composer require smarteknoloji/blade-circle-flags

更新

在更新库时,请参阅 更新指南

Blade 图标

Blade circle-flags 在底层使用 Blade Icons。有关其他功能,请参阅 Blade Icons 读取说明。我们还建议使用此库 启用图标缓存

配置

Blade circle-flags 还提供了使用 Blade Icons 的功能,如默认类、默认属性等。如果您想配置这些,发布 blade-circle-flags.php 配置文件

php artisan vendor:publish --tag=blade-circle-flags-config

使用方法

图标可以作为自闭合的 Blade 组件使用,将编译为 SVG 图标

<x-circleflag-l-zh/>

您也可以向图标组件(旗帜)传递类

<x-circleflag-l-zh class="w-6 h-6 text-gray-500"/>

甚至使用内联样式

<x-circleflag-l-zh style="color: #555"/>

国家旗帜图标可以按如下方式引用

<x-circleflag-c-cn/>

原始 SVG 图标

如果您想将原始 SVG 图标用作资产,可以使用以下方法发布它们

php artisan vendor:publish --tag=blade-circle-flags --force

然后在视图中使用它们,如下所示

<img src="{{ asset('vendor/blade-circle-flags/c-cn.svg') }}" width="10" height="10"/>

更新日志

请查看此存储库中的 更新日志 以获取所有最近更改。

维护者

Blade circle-flags 由 Blade 开发者开发和维护。

许可证

Blade circle-flags 是开源软件,许可证为 MIT 许可证