Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
submodule
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
web_component
submodule
Commits
74dffef9
Commit
74dffef9
authored
May 12, 2020
by
zhuyangbin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
07c6cb0e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
22 deletions
+26
-22
IconFont.js
components/IconFont/IconFont.js
+0
-7
IconFont.ts
components/IconFont/IconFont.ts
+7
-0
index.js
components/IconFont/index.js
+0
-15
index.tsx
components/IconFont/index.tsx
+19
-0
No files found.
components/IconFont/IconFont.js
deleted
100755 → 0
View file @
07c6cb0e
import
{
Icon
}
from
'antd'
;
const
IconFont
=
Icon
.
createFromIconfontCN
({
scriptUrl
:
'//at.alicdn.com/t/font_1509781_pkjtz0jd3g.js'
,
});
export
default
IconFont
;
components/IconFont/IconFont.ts
0 → 100755
View file @
74dffef9
import
{
createFromIconfontCN
}
from
'@ant-design/icons'
;
const
IconFont
=
createFromIconfontCN
({
scriptUrl
:
'//at.alicdn.com/t/font_1509781_7snuvbtppnq.js'
,
});
export
default
IconFont
;
components/IconFont/index.js
deleted
100644 → 0
View file @
07c6cb0e
import
React
from
'react'
;
import
{
Icon
}
from
'antd'
;
import
IconFont
from
'./IconFont'
;
import
styles
from
'./styles.less'
;
const
CustomIcon
=
props
=>
{
const
{
type
,
iconFontType
}
=
props
;
const
isHttp
=
/^
((
https|http
)?
:
\/\/)[^\s]
+/
.
test
(
type
);
if
(
iconFontType
)
{
return
<
IconFont
type
=
{
iconFontType
}
/
>
}
return
isHttp
?
<
img
src
=
{
type
}
alt
=
"icon"
className
=
{
`
${
styles
.
iconCls
}
`
}
/> : <Icon type={type} /
>
};
export
default
CustomIcon
\ No newline at end of file
components/IconFont/index.tsx
0 → 100644
View file @
74dffef9
import
React
from
'react'
;
import
IconFont
from
'./IconFont'
;
import
styles
from
'./styles.less'
;
interface
IProps
{
type
?:
string
;
src
?:
string
;
}
const
CustomIcon
=
(
props
:
IProps
)
=>
{
const
{
type
,
src
}
=
props
;
const
isHttp
=
/^
((
https|http
)?
:
\/\/)[^\s]
+/
.
test
(
src
||
''
);
if
(
type
)
{
return
<
IconFont
type=
{
type
}
/>;
}
if
(
src
&&
isHttp
)
{
return
<
img
src=
{
src
}
alt=
"icon"
className=
{
`${styles.iconCls}`
}
/>;
}
return
null
;
};
export
default
CustomIcon
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment