| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <template>
- <div class="container news-container">
- <left></left>
- <right v-on:childEvent="listenChild"></right>
- </div>
- </template>
- <script>
- import { Left, Right } from '~components/news'
- export default {
- layout: 'main',
- data () {
- return {
- pageSize: 10,
- nowPage: 1
- }
- },
- fetch ({ store }) {
- return Promise.all([
- store.dispatch('loadAllNews', { page: this.nowPage, pageSize: this.pageSize }),
- store.dispatch('loadHotNews')
- ])
- },
- components: {
- Left,
- Right
- },
- methods: {
- listenChild: function (nPage) {
- this.nowPage = nPage
- this.$store.dispatch('loadAllNews', { page: this.nowPage, pageSize: this.pageSize })
- }
- }
- }
- </script>
- <style>
- *{
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
- }
- .footer .item{
- margin-top: 20px;
- }
- .navbar{
- height: 36px!important;
- min-height: 36px!important;
- }
- .news-container{
- font: 100%/1.2 verdana, "Microsoft YaHei", '宋体', serif;
- }
- .hot-news a:hover{
- text-decoration: underline;
- }
- .news-content a:hover{
- text-decoration: underline;
- }
- div{
- display: block;
- }
- </style>
|