refactor
This commit is contained in:
12
src/components/Icon.tsx
Normal file
12
src/components/Icon.tsx
Normal file
@ -0,0 +1,12 @@
|
||||
// 有点丑陋 但是功能在
|
||||
import { h, compile } from 'vue';
|
||||
|
||||
type Props = {
|
||||
name: string;
|
||||
};
|
||||
const Icon = (props: Props) => {
|
||||
return(props.name ? h(compile(`<${props.name} />`)) : null)
|
||||
}
|
||||
|
||||
export default Icon;
|
||||
|
||||
Reference in New Issue
Block a user