Fix player names in FollowTarget

This commit is contained in:
James Lyne 2020-12-14 00:51:51 +00:00
parent 4393890661
commit 4c91b3225e

View File

@ -3,9 +3,9 @@
<h2>Following</h2> <h2>Following</h2>
<div class="following__target"> <div class="following__target">
<img width="32" height="32" class="target__icon" src="images/player_face.png" alt="" /> <img width="32" height="32" class="target__icon" :src="playerImage" alt="" />
<span class="target__name">{{ target.name }}</span> <span class="target__name" v-html="target.name"></span>
<button class="target__unfollow" type="button" :title="`Unfollow ${target.name}`" <button class="target__unfollow" type="button" :title="`Stop following this player`"
@click.prevent="unfollow" @click.prevent="unfollow"
@keydown="onKeydown">Unfollow</button> @keydown="onKeydown">Unfollow</button>
</div> </div>
@ -18,6 +18,8 @@ import {DynmapPlayer} from "@/dynmap";
import {useStore} from "@/store"; import {useStore} from "@/store";
import {MutationTypes} from "@/store/mutation-types"; import {MutationTypes} from "@/store/mutation-types";
const playerImage = require('@/assets/images/player_face.png');
export default defineComponent({ export default defineComponent({
name: 'FollowTarget', name: 'FollowTarget',
props: { props: {
@ -26,6 +28,11 @@ export default defineComponent({
required: true required: true
} }
}, },
data() {
return {
playerImage,
}
},
methods: { methods: {
unfollow() { unfollow() {
useStore().commit(MutationTypes.CLEAR_FOLLOW, undefined); useStore().commit(MutationTypes.CLEAR_FOLLOW, undefined);