Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <div class="l_content">
- <div class="l_downloads">
- <contentBlock :items="items" :selected="selected"></contentBlock>
- </div>
- </div>
- </template>
- <script>
- import {getData} from '@/helpers/request'
- import ContentBlock from './components/Content.vue'
- export default {
- name: 'downloads',
- data () {
- return {
- items: {},
- }
- },
- created () {
- this.getData();
- },
- methods: {
- getData () {
- getData('showListPage:downloads').then(result => {
- result.items.forEach(item => {
- if (!this.items[item.id] || JSON.stringify(this.items[item.id]) !== JSON.stringify(item)) {
- this.$set(this.items, item.id, item)
- }
- });
- this.timer = setTimeout(() => {
- this.getData();
- }, 1000);
- });
- }
- },
- components: {
- ContentBlock
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement