components/icon

Biểu tượng nét (truck, shield, return, support, payment, gift, star, store, clock, check). Truyền vào: {% include 'components/icon', icon: 'truck' %}.

Biến đầu vào

Component đọc biến có sẵn tại chỗ chèn. Những biến dưới đây phải tồn tại, nếu không component sẽ dựng ra khối rỗng.

Chưa có mục nào.

Cách chèn

{% for  in s %}
  {% include 'components/icon' %}
{% endfor %}

Đường dẫn trong {% include %} tính từ gốc bộ giao diện và không có đuôi .html.

Mã đầy đủ

Toàn bộ tệp components/icon.html của bộ giao diện mặc định.

{%- comment -%}Biểu tượng nét đơn giản. Biến vào: icon (truck|shield|return|support|payment|gift|star|check|store|clock).{%- endcomment -%}
<svg class="icon" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">
{%- case icon -%}
{%- when 'truck' -%}<path d="M1 4h14v12H1zM15 9h4l3 3v4h-7"/><circle cx="6" cy="18" r="2"/><circle cx="18" cy="18" r="2"/>
{%- when 'shield' -%}<path d="M12 2 4 5v6c0 5 3.4 9.4 8 11 4.6-1.6 8-6 8-11V5z"/><path d="m9 12 2 2 4-4"/>
{%- when 'return' -%}<path d="M3 12a9 9 0 1 0 3-6.7L3 8"/><path d="M3 3v5h5"/>
{%- when 'support' -%}<path d="M3 14v-2a9 9 0 0 1 18 0v2"/><path d="M21 15a2 2 0 0 1-2 2h-1v-6h1a2 2 0 0 1 2 2zM3 15a2 2 0 0 0 2 2h1v-6H5a2 2 0 0 0-2 2z"/>
{%- when 'payment' -%}<rect x="2" y="5" width="20" height="14" rx="2"/><path d="M2 10h20M6 15h4"/>
{%- when 'gift' -%}<path d="M20 12v10H4V12M2 7h20v5H2zM12 22V7M12 7H7.5a2.5 2.5 0 1 1 0-5C11 2 12 7 12 7zM12 7h4.5a2.5 2.5 0 1 0 0-5C13 2 12 7 12 7z"/>
{%- when 'star' -%}<path d="m12 2 3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z"/>
{%- when 'store' -%}<path d="M3 9 5 3h14l2 6M3 9h18v12H3zM9 21v-6h6v6"/>
{%- when 'clock' -%}<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>
{%- else -%}<path d="M20 6 9 17l-5-5"/>
{%- endcase -%}
</svg>

Dùng ở

Chưa có mục nào.