| 12345678910111213141516171819 |
- const r = `<template>\r
- <svg aria-hidden="true" :width="size" :height="size" :fill="color">\r
- <use :xlink:href="\`#icon-\${name}\`" />\r
- </svg>\r
- </template>\r
- <script setup>\r
- defineProps({\r
- // 雪碧图里的图标 id(不带 icon- 前缀,对应 <symbol id="icon-xxx">)\r
- name: { type: String },\r
- // 图标尺寸,宽高取同一个值;不传时由外部 CSS 控制\r
- size: { type: [String, Number] },\r
- // 填充色;不传则用 currentColor 跟随文字颜色\r
- color: { type: String }\r
- })\r
- <\/script>\r
- `;
- export {
- r as default
- };
|