-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aeb2ca6
commit 580ee2f
Showing
33 changed files
with
162 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.svg-icon { | ||
width: 30px; | ||
height: 30px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react' | ||
import styles from './index.less' | ||
|
||
import '@/icon' | ||
|
||
interface SvgIconProps { | ||
name: string | ||
width?: string | number | ||
height?: string | number | ||
} | ||
|
||
/** | ||
* @description: SvgIcon | ||
* @author: KaifengLi | ||
* @version: 1.0.0 | ||
* @Date: 2024-06-26 13:43:13 | ||
*/ | ||
const SvgIcon = (props: SvgIconProps) => { | ||
const { width = 30, height = 30, name } = props | ||
|
||
return ( | ||
<svg className={styles['svg-icon']} style={{ width: width, height: height }}> | ||
<use xlinkHref={'#' + name}></use> | ||
</svg> | ||
) | ||
} | ||
|
||
export default SvgIcon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const req = require.context('./svg/', false, /.svg$/) | ||
const requireAll = (requireContext: __WebpackModuleApi.RequireContext) => | ||
requireContext.keys().map(requireContext) | ||
|
||
requireAll(req) | ||
|
||
console.log(requireAll(req)) | ||
|
||
export default requireAll(req) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.