keanu-weblite/src/components/RoomList.vue

36 lines
927 B
Vue
Raw Normal View History

2020-11-09 10:26:56 +01:00
<template>
<v-list dense>
2020-11-09 10:26:56 +01:00
<v-subheader>ROOMS</v-subheader>
<v-list-item-group v-model="currentRoomId" color="primary">
<v-list-item v-for="room in $matrix.rooms" :key="room.roomId" :value="room.roomId">
<v-list-item-avatar>
<v-img :src="room.avatar" />
</v-list-item-avatar>
2020-11-09 10:26:56 +01:00
<v-list-item-content>
2020-11-09 15:55:17 +01:00
<v-list-item-title>{{ room.summary.info.title }}</v-list-item-title>
<v-list-item-subtitle>{{ room.topic }}</v-list-item-subtitle>
2020-11-09 10:26:56 +01:00
</v-list-item-content>
</v-list-item>
</v-list-item-group>
</v-list>
</template>
<script>
2021-02-01 16:04:12 +01:00
import util from "../plugins/utils";
2020-11-09 10:26:56 +01:00
export default {
name: "RoomList",
data: () => ({
currentRoomId: -1,
2020-11-09 10:26:56 +01:00
}),
watch: {
currentRoomId() {
2020-11-19 17:11:11 +01:00
this.$emit("close");
2021-02-01 16:04:12 +01:00
this.$navigation.push({name: 'Chat', params: { roomId: util.sanitizeRoomId(this.currentRoomId) }}, -1);
2020-11-09 10:26:56 +01:00
},
},
};
</script>