L
L
Luc1fer2019-04-19 11:47:58
Vue.js
Luc1fer, 2019-04-19 11:47:58

How to implement switching to the next and previous pages on the detailed page of a news or promotion?

How to implement switching to the next and previous pages on the detailed page of a news or promotion, so that when the user reaches the end of the button, the next or previous one would switch to disable mode?
5cb98ae5b6382897454161.jpeg
Here is the structure:

news:[
        {
            	id:'0',
            	img: '/img/news/news1.jpg',
            	title:'Заголовок',
            	description:'Описание',
            	date:'25.04.2019',
            	view: 365,
            },
]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2019-04-19
@lexapashkov

There is an array of news, there is current news. You can find out the position of the current news in the array, and thus understand what news will be the previous and next (and whether they exist at all). What's the problem?
UPD. Small example .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question