<template>
  <div id="model-2">
    <el-row class="list" @click.native="toDetail">
      <el-col :span="24" class="title">
        {{ data.title }}
      </el-col>
      <el-col :span="24" class="other">
        <p>
          <span>{{ data.origin || '暂无' }}</span>
          <span>{{ data.publish_time || '暂无' }}</span>
        </p>
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, createNamespacedHelpers } from 'vuex';
export default {
  name: 'model-2',
  props: { data: { type: Object, default: () => {} } },
  components: {},
  data: function () {
    return {};
  },
  created() {},
  methods: {
    toDetail() {
      this.$router.push({ path: this.detailRouter, query: { id: this.data._id } });
    },
  },
  computed: {
    ...mapState(['user', 'menuParams']),
    pageTitle() {
      return `${this.$route.meta.title}`;
    },
    detailRouter() {
      const key = this.$route.meta.key;
      return `/${key}/detail`;
    },
  },
  metaInfo() {
    return { title: this.$route.meta.title };
  },
};
</script>

<style lang="less" scoped>
.list {
  padding: 10px 5px;
  background: #fff;
  margin: 0 0 5px 0;
  border-radius: 5px;
  .title {
    font-size: 15px;
    font-weight: bold;
    margin: 0 0 5px 0;
  }
  .other {
    p {
      span {
        display: inline-block;
        width: 50%;
        font-size: 14px;
        color: #666;
      }
    }
  }
}
</style>
