Commit 67432de9 authored by sixiaofeng's avatar sixiaofeng

app-icon组件修改

parent 7dcc873b
<template>
<fragment>
<div v-if="type==='png'" :class="className" @click="handleClick">
<img :src="path ? path : require(`@/assets/icons/${iconName}.png`)" class="object-cover object-center " >
<img :src="getImagePath" class="object-cover object-center " >
</div>
<svg v-else aria-hidden="true" :height="size" :width="size" :fill="color" @click="handleClick">
<use :xlink:href="'#'+name" ></use>
......@@ -35,6 +35,14 @@ export default Vue.extend({
iconName: String,
className: String,
},
computed: {
getImagePath() {
if (this.path) {
return this.path
}
return require(`@/assets/icons/${this.iconName}.png`)
}
},
methods: {
handleClick() {
this.$emit('click')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment