Hi!
What i want to do, is get component (http://framework7.io/docs/router-component.html) object in swipers ‘renderSlide’ and append it to slide.
(Because of i want have stunning components features like methods, callback, styling etc. in every single page).
My try was:
var swiper = page.app.swiper.create('#main-swiper', {
virtual: {
addSlidesBefore:2,
addSlidesAfter:1,
slides: ['/aaa/', '/bbb/', '/ccc/', 'Slide 44', 'Slide 55'],
renderSlide: function (slide, index) {
// there i dont know how to get component, or page, or content by url
var componentAtRouteAAA = app.router.navigate('/aaa/');
var newPage = '<div class="swiper-slide" data-index="'+index+'">'+componentAtRouteAAA+'</div>';
return newPage;
}
},
});
But it is the mistake, because navigate app.router.navigate returns only router and append content inside next page in DOM, not inside current slide.
Next try was create view from slide:
...
renderSlide: function (slide, index) {
var x = '<div class="swiper-slide" data-index="'+index+'"></div>';
var view = app.views.create(x, {
url: '/aaa/'
});
return x;
}
...
Doesnt work too.
Last one was, im looked into documentation of swiper, and maybe is answer “renderExternal”, but i dont know how to use router component there. https://idangero.us/swiper/api/#virtual .
Anybody can help please?