chore: version 2.8.3 (#175)

* feat: 保留已存在的内容直到手动操作

* feat: 支持复制文本

* chore: version 2.8.3
This commit is contained in:
Redon
2023-03-01 13:20:31 +08:00
committed by GitHub
parent 94e23bb916
commit 42e320fe35
12 changed files with 175 additions and 32 deletions

View File

@@ -0,0 +1,36 @@
import { h } from 'vue'
import { SvgIcon } from '@/components/common'
export const useIconRender = () => {
interface IconConfig {
icon?: string
color?: string
fontSize?: number
}
interface IconStyle {
color?: string
fontSize?: string
}
const iconRender = (config: IconConfig) => {
const { color, fontSize, icon } = config
const style: IconStyle = {}
if (color)
style.color = color
if (fontSize)
style.fontSize = `${fontSize}px`
if (!icon)
window.console.warn('iconRender: icon is required')
return () => h(SvgIcon, { icon, style })
}
return {
iconRender,
}
}