From aea0fa999fd09951835b2d74c53137624f46929e Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 21 May 2018 13:09:05 +0200 Subject: major redesign --- src/TalentImage.vue | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'src/TalentImage.vue') diff --git a/src/TalentImage.vue b/src/TalentImage.vue index b7cb78c..3e3c2db 100644 --- a/src/TalentImage.vue +++ b/src/TalentImage.vue @@ -20,19 +20,13 @@ import * as maps from './maps/maps'; export default Vue.component('talent-image', { props: [ 'entry', 'size' ], - data: function() { - return { - hero: maps.getHero(this.entry.Actor), - rarity: maps.getTalentRarity(this.entry.Talent), - }; + computed: { + hero: function() { + return maps.getHero(this.entry.Actor); + }, + rarity: function() { + return maps.getTalentRarity(this.entry.Talent); + }, }, - - watch: { - entry: function(newEntry, oldEntry) { - // This is needed so component will recalculate whenever there is a change on entry - this.hero = maps.getHero(this.entry.Actor); - this.rarity = maps.getTalentRarity(this.entry.Talent); - } - } }); -- cgit v1.3.1