hardlounge/client/components/UsernameFiltered.vue

33 lines
569 B
Vue
Raw Normal View History

2018-07-08 19:02:36 +00:00
<template>
<span
:class="['user', nickColor, {active: active}]"
2018-07-08 19:02:36 +00:00
:data-name="user.original.nick"
2018-07-08 20:08:08 +00:00
role="button"
@mouseover="hover"
v-html="user.original.mode + user.string"
/>
2018-07-08 19:02:36 +00:00
</template>
<script>
const colorClass = require("../js/helpers/colorClass");
2018-07-08 19:02:36 +00:00
export default {
name: "UsernameFiltered",
props: {
user: Object,
active: Boolean,
2018-07-10 23:25:21 +00:00
onHover: Function,
},
computed: {
nickColor() {
return colorClass(this.user.original.nick);
},
},
2018-07-10 23:25:21 +00:00
methods: {
hover() {
this.onHover ? this.onHover(this.user.original) : null;
},
2018-07-08 19:02:36 +00:00
},
};
</script>