ui库和web端产品库合并版本(还需修复细节)
This commit is contained in:
38
ui/packages/basic/AiIcon.vue
Normal file
38
ui/packages/basic/AiIcon.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<div class="AiIcon">
|
||||
<div v-if="type=='icon'" class="iconfont" :class="icon"/>
|
||||
<div v-if="type=='logo'" class="logofont" :class="icon"/>
|
||||
<svg v-if="type=='svg'" class="icon" aria-hidden="true">
|
||||
<use :xlink:href="`#${icon}`"></use>
|
||||
</svg>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import "../../meta/styles/iconfont/iconfont";
|
||||
import "../../meta/styles/iconfont/iconfont.css";
|
||||
import "../../meta/styles/iconfont/logofont.css";
|
||||
|
||||
export default {
|
||||
name: "AiIcon",
|
||||
props: {
|
||||
type: {type: String, default: "icon"},
|
||||
icon: {type: String, required: true},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.AiIcon {
|
||||
box-sizing: border-box;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
font-size: 16px;
|
||||
|
||||
.iconfont, .logofont, .icon {
|
||||
font-size: inherit;
|
||||
width: inherit;
|
||||
height: inherit;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user