fix some errors on front

This commit is contained in:
grimhilt
2023-04-02 13:36:59 +02:00
parent 948ec3c7b4
commit 7f535f2e95
13 changed files with 546 additions and 311 deletions

View File

@@ -1,24 +1,27 @@
<script setup>
import {defineProps} from "vue";
const props = defineProps({ room: Object });
</script>
<template>
<div id="main">
header -> sender
-> thread
-> single click open side
-> double click open plain
is thread
<div class="main">
<div>
{{ props }}
type: name / sender
</div>
<div>
action:
threads
message important
</div>
</div>
</template>
<script>
export default {
name: 'Header',
components: {
}
}
</script>
<style scoped>
#main {
.main {
border-bottom: 1px solid #505050;
width: 100%;
height: 51px;

View File

@@ -10,8 +10,8 @@ const route = useRoute();
let { id } = route.params;
onBeforeMount(async () => {
// get data
console.log(store.state.rooms.find((room) => room.id === id)?.fetched);
let room = store.state.rooms.find((room) => room.id === id);
console.log(room)
if (!room || room?.fetched === false) {
// todo
// await store.dispatch("fetchMessages", );
@@ -29,7 +29,7 @@ onBeforeRouteUpdate(async (to, from) => {
<template>
<div id="main">
<Header></Header>
<Header :room="room" ></Header>
<div id="RoomViewBody">
<div class="content">
<Message v-for="(message, index) in store.getters.messages(id)" :key="index" :data="message" />

View File

@@ -25,11 +25,12 @@ export default {
<style scoped>
.container {
max-width: 32px;
width: 65px;
text-align: center;
white-space: normal;
word-wrap: break-word;
padding: 5px;
margin: 1px 0;
margin: 3px 0;
cursor: pointer;
border-radius: 8px;
border: 2px solid transparent;

View File

@@ -1,16 +1,13 @@
<script setup>
import Thread from './Thread.vue';
import { defineProps } from 'vue'
import Thread from "./Thread.vue";
import { defineProps } from "vue";
const props = defineProps({ threads: [Object] });
console.log(props.threads)
</script>
<template>
<div>
<Thread v-for="(thread, index) in props.threads" :key="index" :thread="thread" />
<Thread v-for="(thread, index) in props.threads" :key="index" :thread="thread" />
</div>
</template>
<style scoped>
</style>
<style scoped></style>