mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 22:10:22 +00:00
32 lines
536 B
Vue
32 lines
536 B
Vue
<template>
|
|
<span
|
|
:class="['user', nickColor, {active: active}]"
|
|
:data-name="user.nick"
|
|
role="button"
|
|
v-on="onHover ? {mouseover: hover} : {}"
|
|
>{{ user.mode }}{{ user.nick }}</span
|
|
>
|
|
</template>
|
|
|
|
<script>
|
|
const colorClass = require("../js/helpers/colorClass");
|
|
|
|
export default {
|
|
name: "Username",
|
|
props: {
|
|
user: Object,
|
|
active: Boolean,
|
|
onHover: Function,
|
|
},
|
|
computed: {
|
|
nickColor() {
|
|
return colorClass(this.user.nick);
|
|
},
|
|
},
|
|
methods: {
|
|
hover() {
|
|
return this.onHover(this.user);
|
|
},
|
|
},
|
|
};
|
|
</script>
|