|
|
<template>
|
|
|
<div></div>
|
|
|
<resources v-bind:content-code.sync="contentCode"></resources>
|
|
|
<div v-for="news in newsList" class="news-box">
|
|
|
<span class="tag">{{news.tag}}</span>
|
|
|
<div class="img">
|
|
|
<a href="{{news.href}}">
|
|
|
<img src="{{news.src}}" alt="" />
|
|
|
</a>
|
|
|
</div>
|
|
|
<div class="title"><a href="{{news.href}}">{{news.title}}</a></div>
|
|
|
<div class="news-des">
|
|
|
{{news.des}}
|
|
|
</div>
|
|
|
<div class="bottom">
|
|
|
<span class="icon time-icon"></span>
|
|
|
<span class="time">{{news.time}}</span>
|
|
|
<span class="icon share"></span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<style>
|
|
|
.news-box {
|
|
|
position: absolute;
|
|
|
|
|
|
.tag {
|
|
|
position: relative;
|
|
|
top: 35px;
|
|
|
left: 0;
|
|
|
padding: 5px;
|
|
|
background: #000;
|
|
|
color: #fff;
|
|
|
}
|
|
|
.img {
|
|
|
width: 100%;
|
|
|
height: auto;
|
|
|
overflow: hidden;
|
|
|
|
|
|
img {
|
|
|
width: 100%;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.title {
|
|
|
font-size: 32px;
|
|
|
font-weight: 700;
|
|
|
padding: 10px 20px;
|
|
|
}
|
|
|
|
|
|
.news-des {
|
|
|
padding: 10px 20px;
|
|
|
color: #939393;
|
|
|
}
|
|
|
|
|
|
.bottom {
|
|
|
padding: 10px 20px;
|
|
|
color: #939393;
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
<script>
|
|
|
const contentCode = require('content-code');
|
|
|
const resources = require('component/resources/index.vue');
|
|
|
const qs = require('yoho-qs');
|
|
|
|
|
|
module.exports = {
|
|
|
data() {
|
|
|
return {
|
|
|
msg: 'hello vue'
|
|
|
contentCode: contentCode.brand[qs.brand || 'men'],
|
|
|
newsList: [
|
|
|
{
|
|
|
href: '//m.yoholbk.com',
|
|
|
title: '这是一个标题',
|
|
|
des: '这是一个副标题',
|
|
|
time: '04.19 18.05',
|
|
|
tag: '运动',
|
|
|
src: 'http://7xwj52.com1.z0.glb.clouddn.com/brandbg.jpg',
|
|
|
}
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
components: {
|
|
|
resources
|
|
|
}
|
|
|
};
|
|
|
</script> |
...
|
...
|
|