fix some errors on front
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user