more refactoring, removing imports
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { AppStorage } from '../AppStorage'
|
||||
import { Api, AppStorage } from '../AppStorage'
|
||||
|
||||
export default {
|
||||
props: ["id"],
|
||||
data () { return {
|
||||
notifications: [],
|
||||
loot: [],
|
||||
}},
|
||||
methods: {
|
||||
updateWealth (value) {
|
||||
@@ -20,6 +21,20 @@ export default {
|
||||
.then(_ => { if (AppStorage.debug) this.notifications.push("Claim withdrawn")})
|
||||
|
||||
},
|
||||
parseLoot (items) {
|
||||
this.loot = [];
|
||||
items.map(item => {
|
||||
this.loot.push(item);
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
id: {
|
||||
immediate: true,
|
||||
handler: function(newId) {
|
||||
Api.fetchLoot(newId).then(this.parseLoot);
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
player () {
|
||||
@@ -29,14 +44,14 @@ export default {
|
||||
cp: '-', sp: '-', gp: '-', pp: '-',
|
||||
debt: 0 };
|
||||
} else {
|
||||
console.log("Update player");
|
||||
return AppStorage.state.player_list[this.id];
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
render () {
|
||||
return this.$scopedSlots.default({
|
||||
player: this.player,
|
||||
loot: this.loot,
|
||||
notifications: this.notifications,
|
||||
actions: {
|
||||
updateWealth: this.updateWealth,
|
||||
|
||||
Reference in New Issue
Block a user