From a6f86ee315a373382ef8dfab5b799a74ade6968d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E4=BC=A0=E9=BE=99?= Date: Sat, 23 Apr 2022 19:09:06 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=81=E8=A3=85renderIcon=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/icon.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/utils/icon.js diff --git a/src/utils/icon.js b/src/utils/icon.js new file mode 100644 index 0000000..fd71103 --- /dev/null +++ b/src/utils/icon.js @@ -0,0 +1,6 @@ +import { h } from 'vue' +import { NIcon } from 'naive-ui' + +export function renderIcon(icon, props = { size: 12 }) { + return () => h(NIcon, { ...props }, { default: () => h(icon) }) +}