Skip to content

pantoken-root / renderers/svelte/src / icon

Hàm: icon() ​

icon(node, name): ActionResult

Thử nghiệm

Hành động Svelte: <span use:icon={"arrow-left"} /> kết xuất SVG nội tuyến của biểu tượng vào node.

Tham số ​

node ​

Element

Phần tử chủ.

name ​

string

Tên biểu tượng.

Trả về ​

ActionResult

Ví dụ ​

svelte
<script>
  import { icon } from "@pantoken/svelte";
  import "@pantoken/css";
</script>

<span use:icon={"arrow-left"} />