-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 所有 icon 替换为 svg, 修复 iconfont 样式影响问题 #7
- Loading branch information
朱文涵
committed
Jul 12, 2020
1 parent
aaf572c
commit 13de05d
Showing
6 changed files
with
97 additions
and
14 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
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,38 @@ | ||
<template> | ||
<svg class="svg-icon" aria-hidden="true" @click="handleClick"> | ||
<use :xlink:href="iconName" /> | ||
</svg> | ||
</template> | ||
|
||
<script> | ||
import 'https://at.alicdn.com/t/font_1239600_7r0qv8bues.js' | ||
export default { | ||
name: 'SvgIcon', | ||
props: { | ||
name: { | ||
type: String, | ||
required: true | ||
} | ||
}, | ||
computed: { | ||
iconName () { | ||
return `#icon-${this.name}` | ||
} | ||
}, | ||
methods: { | ||
handleClick () { | ||
this.$listeners.click && this.$listeners.click() | ||
} | ||
} | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.svg-icon { | ||
width: 1em; | ||
height: 1em; | ||
vertical-align: -0.15em; | ||
fill: currentColor; | ||
overflow: hidden; | ||
} | ||
</style> |
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