-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ : add a vue component to display user badge
- Loading branch information
1 parent
862652c
commit 0cfe94f
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<template id="user-badge-template"> | ||
<span class="user_badge" :class="cssClass"> | ||
<a href="#">{{user.username}}</a> | ||
<i v-if="user.admin" class="fas fa-user-shield"></i> | ||
</span> | ||
</template> | ||
|
||
<script> | ||
Vue.component('user-badge', { | ||
template: '#user-badge-template', | ||
props: ['user', 'cssClass'], | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
.user_badge a { | ||
color: #3273dc !important; | ||
text-decoration: none !important; | ||
} | ||
.user_badge .fa-user-shield { | ||
color: #ff9900; | ||
} | ||
</style> |