Skip to content

Commit

Permalink
feat(ui): ItemLogo recognize images in 'icon' field
Browse files Browse the repository at this point in the history
  • Loading branch information
Guillaume Chau committed Apr 30, 2018
1 parent 98f6a16 commit 9898dc0
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions packages/@vue/cli-ui/src/components/ItemLogo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
icon="done"
/>
<img
v-else-if="image && !error"
v-else-if="imageEnabled && !error"
class="image"
:src="image"
:key="image"
:src="imageUrl"
:key="imageUrl"
@load="loaded = true"
@error="error = true"
>
Expand Down Expand Up @@ -65,6 +65,16 @@ export default {
}
},
computed: {
imageEnabled () {
return this.image || (this.icon && this.icon.indexOf('.') !== -1)
},
imageUrl () {
return this.image || this.icon
}
},
watch: {
image: 'reset',
selected: 'reset'
Expand Down

0 comments on commit 9898dc0

Please sign in to comment.