2020-01-30 04:37:25 +09:00
|
|
|
<template>
|
2020-06-03 13:30:17 +09:00
|
|
|
<mk-tooltip :source="source" ref="tooltip">
|
|
|
|
<template v-if="users.length <= 10">
|
|
|
|
<b v-for="u in users" :key="u.id" style="margin-right: 12px;">
|
|
|
|
<mk-avatar :user="u" style="width: 24px; height: 24px; margin-right: 2px;"/>
|
|
|
|
<mk-user-name :user="u" :nowrap="false" style="line-height: 24px;"/>
|
|
|
|
</b>
|
|
|
|
</template>
|
|
|
|
<template v-if="10 < users.length">
|
|
|
|
<b v-for="u in users" :key="u.id" style="margin-right: 12px;">
|
|
|
|
<mk-avatar :user="u" style="width: 24px; height: 24px; margin-right: 2px;"/>
|
|
|
|
<mk-user-name :user="u" :nowrap="false" style="line-height: 24px;"/>
|
|
|
|
</b>
|
|
|
|
<span slot="omitted">+{{ count - 10 }}</span>
|
|
|
|
</template>
|
|
|
|
</mk-tooltip>
|
2020-01-30 04:37:25 +09:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import Vue from 'vue';
|
2020-06-03 13:30:17 +09:00
|
|
|
import MkTooltip from './ui/tooltip.vue';
|
2020-01-30 04:37:25 +09:00
|
|
|
|
|
|
|
export default Vue.extend({
|
2020-06-03 13:30:17 +09:00
|
|
|
components: {
|
|
|
|
MkTooltip
|
|
|
|
},
|
2020-01-30 04:37:25 +09:00
|
|
|
props: {
|
|
|
|
reaction: {
|
|
|
|
type: String,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
users: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
count: {
|
|
|
|
type: Number,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
source: {
|
|
|
|
required: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
close() {
|
2020-06-03 13:30:17 +09:00
|
|
|
this.$refs.tooltip.close();
|
2020-01-30 04:37:25 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
</script>
|