12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <template>
- <div id="item">
- <el-row type="flex" @click.native="toEdit" class="item">
- <el-col :span="9" class="i_row">
- <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="15" class="s_row">
- <el-col :span="24" class="dl2">{{ data.title }}</el-col>
- <el-col :span="24" class="last__row">
- <el-col :span="18"> {{ data.create_time }} </el-col>
- <el-col :span="6">阅读: {{ data.read }} </el-col>
- </el-col>
- </el-col>
- </el-row>
- </div>
- </template>
- <script>
- import { mapState, createNamespacedHelpers } from 'vuex';
- export default {
- name: 'item',
- props: { data: { type: Object, default: () => {} } },
- components: {},
- data: function() {
- return {
- noImg: require('@a/noImg.jpg'),
- };
- },
- created() {},
- 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 };
- },
- };
- </script>
- <style lang="less" scoped>
- @subWord: #666666;
- .item {
- border-bottom: 1px solid #ccc;
- padding: 8px 0;
- .i_row {
- text-align: center;
- /deep/.van-image__img {
- border: 1px solid #f1f1f1;
- }
- }
- .s_row {
- padding: 0 0.3125rem;
- .dl2 {
- font-size: 16px;
- overflow: hidden;
- text-overflow: ellipsis;
- -webkit-line-clamp: 2;
- word-break: break-all;
- display: -webkit-box;
- -webkit-box-orient: vertical;
- }
- .last__row {
- font-size: 0.875rem;
- color: @subWord;
- position: absolute;
- bottom: 10px;
- width: 60%;
- }
- }
- }
- </style>
|