<template>
  <div id="room">
    <el-table :data="list" border stripe :show-header="false" @row-click="toChat">
      <el-table-column align="center">
        <template v-slot="{ row }">
          <template v-if="row.needRead == 0">
            暂无未读消息
          </template>
          <template v-if="row.needRead > 0">
            <span style="color:red">您有{{ row.needRead }}条未读消息 </span>
          </template>
        </template>
      </el-table-column>
      <el-table-column prop="buyer_name" align="center"></el-table-column>
    </el-table>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'room',
  props: {
    list: { type: Array, default: () => [] },
  },
  components: {},
  data: () => {
    return {};
  },
  created() {},
  methods: {
    toChat(row) {
      this.$emit('toChat', row);
    },
  },
  computed: {
    ...mapState(['user']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped></style>
