修改im store问

fix/im-0526
ch 3 years ago
parent 49e78efda8
commit 7d26167a30

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-04 17:48:12
* @LastEditors: ch
* @LastEditTime: 2022-05-26 10:38:16
* @LastEditTime: 2022-05-26 10:50:18
* @Description: file content
-->
@ -43,7 +43,6 @@
</div>
</template>
<script>
// import { mapState } from "vuex";
import UiEmpty from "@/components/UiEmpty.vue";
import {FormatDate} from '@/plugins/utils'
export default {
@ -53,13 +52,13 @@ export default {
},
computed: {
msgData(){
return this.$store.state.socketMsgData.map(i => {
i.payload = JSON.parse(i.payload);
i.createTimeStamp = FormatDate(i.createTimeStamp, 'mm-dd hh:ii:ss')
return i;
return [...this.$store.state.socketMsgData].map(i => {
let item = {...i}
item.payload = JSON.parse(i.payload);
item.createTimeStamp = FormatDate(i.createTimeStamp, 'mm-dd hh:ii:ss')
return item;
}).reverse();
},
// ...mapState(["token", "socketMsgData"]),
},
mounted() {
console.log(`socketMsgData`, this.$store.state);
@ -106,6 +105,7 @@ export default {
&__item {
margin-bottom: 20px;
cursor: pointer;
&-img {
width: 50px;

Loading…
Cancel
Save