js: add slidePosition

This commit is contained in:
pengfei.zhou
2023-04-04 19:49:10 +08:00
committed by osborn
parent f1177e27b4
commit 930593fe0c
11 changed files with 98 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import { View, Property, Superview } from "../ui/view";
import { View, Property, Superview, InconsistProperty } from "../ui/view";
import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig";
import { deepClone } from "./utils";
@@ -133,7 +133,7 @@ __decorate([
__metadata("design:type", Function)
], List.prototype, "onScrollEnd", void 0);
__decorate([
Property,
InconsistProperty,
__metadata("design:type", Number)
], List.prototype, "scrolledPosition", void 0);
__decorate([

View File

@@ -33,6 +33,7 @@ export declare class Slider extends Superview {
minScale: number;
maxScale: number;
};
slidePosition?: number;
/**
* Reload all list items.
* @param context

View File

@@ -22,7 +22,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { Superview, View, Property } from "../ui/view";
import { Superview, View, Property, InconsistProperty } from "../ui/view";
import { Stack } from "./layouts";
import { layoutConfig } from "../util/layoutconfig";
import { deepClone } from "./utils";
@@ -110,6 +110,10 @@ __decorate([
Property,
__metadata("design:type", Object)
], Slider.prototype, "slideStyle", void 0);
__decorate([
InconsistProperty,
__metadata("design:type", Number)
], Slider.prototype, "slidePosition", void 0);
export function slider(config) {
const ret = new Slider;
ret.apply(config);