add loop property & fix bug caused by renderPage cache
This commit is contained in:
@@ -1957,12 +1957,9 @@ var Slider = /** @class */ (function (_super) {
|
||||
return this.cachedViews.values();
|
||||
};
|
||||
Slider.prototype.getItem = function (itemIdx) {
|
||||
var view = this.cachedViews.get("" + itemIdx);
|
||||
if (view === undefined) {
|
||||
view = this.renderPage(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set("" + itemIdx, view);
|
||||
}
|
||||
var view = this.renderPage(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set("" + itemIdx, view);
|
||||
return view;
|
||||
};
|
||||
Slider.prototype.isDirty = function () {
|
||||
@@ -2004,6 +2001,10 @@ var Slider = /** @class */ (function (_super) {
|
||||
Property,
|
||||
__metadata$6("design:type", Function)
|
||||
], Slider.prototype, "onPageSlided", void 0);
|
||||
__decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Slider.prototype, "loop", void 0);
|
||||
return Slider;
|
||||
}(Superview));
|
||||
function slider(config) {
|
||||
|
@@ -1457,12 +1457,9 @@ class Slider extends Superview {
|
||||
return this.cachedViews.values();
|
||||
}
|
||||
getItem(itemIdx) {
|
||||
let view = this.cachedViews.get(`${itemIdx}`);
|
||||
if (view === undefined) {
|
||||
view = this.renderPage(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set(`${itemIdx}`, view);
|
||||
}
|
||||
let view = this.renderPage(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set(`${itemIdx}`, view);
|
||||
return view;
|
||||
}
|
||||
isDirty() {
|
||||
@@ -1503,6 +1500,10 @@ __decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Function)
|
||||
], Slider.prototype, "onPageSlided", void 0);
|
||||
__decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Slider.prototype, "loop", void 0);
|
||||
function slider(config) {
|
||||
const ret = new Slider;
|
||||
for (let key in config) {
|
||||
|
@@ -2916,12 +2916,9 @@ class Slider extends Superview {
|
||||
return this.cachedViews.values();
|
||||
}
|
||||
getItem(itemIdx) {
|
||||
let view = this.cachedViews.get(`${itemIdx}`);
|
||||
if (view === undefined) {
|
||||
view = this.renderPage(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set(`${itemIdx}`, view);
|
||||
}
|
||||
let view = this.renderPage(itemIdx);
|
||||
view.superview = this;
|
||||
this.cachedViews.set(`${itemIdx}`, view);
|
||||
return view;
|
||||
}
|
||||
isDirty() {
|
||||
@@ -2962,6 +2959,10 @@ __decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Function)
|
||||
], Slider.prototype, "onPageSlided", void 0);
|
||||
__decorate$6([
|
||||
Property,
|
||||
__metadata$6("design:type", Boolean)
|
||||
], Slider.prototype, "loop", void 0);
|
||||
function slider(config) {
|
||||
const ret = new Slider;
|
||||
for (let key in config) {
|
||||
|
Reference in New Issue
Block a user