|
@@ -1,6 +1,25 @@
|
|
|
<template>
|
|
|
<div id="item">
|
|
|
- <p>item</p>
|
|
|
+ <el-row type="flex" class="list__row" @click.native="toEdit">
|
|
|
+ <el-col :span="9">
|
|
|
+ <van-image :src="data.imgUrl" :width="imgpx" :height="imghpx" fit="scale-down">
|
|
|
+ <template #error>
|
|
|
+ <van-image :src="noImg" :width="imgpx" :height="imghpx" fit="scale-down" />
|
|
|
+ </template>
|
|
|
+ </van-image>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="14">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="dl2">{{ data.title }}</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-row type="flex" align="middle" class="last__row">
|
|
|
+ <el-col :span="18"> {{ data.create_time }} </el-col>
|
|
|
+ <el-col :span="6">阅读: {{ data.read }} </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -8,18 +27,30 @@
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
export default {
|
|
|
name: 'item',
|
|
|
- props: {},
|
|
|
+ props: { data: { type: Object, default: () => {} } },
|
|
|
components: {},
|
|
|
data: function() {
|
|
|
- return {};
|
|
|
+ return {
|
|
|
+ noImg: require('@a/noImg.jpg'),
|
|
|
+ };
|
|
|
},
|
|
|
created() {},
|
|
|
- methods: {},
|
|
|
+ methods: {
|
|
|
+ toEdit() {
|
|
|
+ this.$router.push({ path: '/adminRefute/edit', query: { id: this.data._id } });
|
|
|
+ },
|
|
|
+ },
|
|
|
computed: {
|
|
|
...mapState(['user', 'menuParams']),
|
|
|
pageTitle() {
|
|
|
return `${this.$route.meta.title}`;
|
|
|
},
|
|
|
+ imgpx() {
|
|
|
+ return 120;
|
|
|
+ },
|
|
|
+ imghpx() {
|
|
|
+ return this.imgpx * 0.8;
|
|
|
+ },
|
|
|
},
|
|
|
metaInfo() {
|
|
|
return { title: this.$route.meta.title };
|
|
@@ -27,4 +58,29 @@ export default {
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
-<style lang="less" scoped></style>
|
|
|
+<style lang="less" scoped>
|
|
|
+@wordHeight: 1rem;
|
|
|
+@subWord: #666666;
|
|
|
+.list__row {
|
|
|
+ padding: 0.3125rem;
|
|
|
+ border-bottom: 1px solid #ccc;
|
|
|
+ min-height: 6.375rem;
|
|
|
+}
|
|
|
+.s__row {
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.last__row {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 15px;
|
|
|
+ font-size: 0.875rem;
|
|
|
+ color: @subWord;
|
|
|
+}
|
|
|
+.dl2 {
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
+ word-break: break-all;
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+}
|
|
|
+</style>
|