project init

This commit is contained in:
2023-01-28 14:37:45 +08:00
parent fa1176f658
commit 3a134326e7
83 changed files with 1482 additions and 140 deletions

View File

@@ -160,18 +160,20 @@ let Tabs = class Tabs extends SuperComponent {
return offset + targetLeft - (1 / 2) * containerWidth + targetWidth / 2;
}
getTrackSize() {
// return new Promise((resolve) => {
// if (this.trackWidth) {
// resolve(this.trackWidth);
// return;
// }
// getRect(this, `.${prefix}-tabs__track`).then((res) => {
// if (res) {
// this.trackWidth = res.width;
// resolve(this.trackWidth);
// }
// });
// });
return new Promise((resolve) => {
if (this.trackWidth) {
resolve(this.trackWidth);
return;
}
getRect(this, `.${prefix}-tabs__track`).then((res) => {
if (res) {
this.trackWidth = res.width;
resolve(this.trackWidth);
}
}).catch(reason => {
console.log(reason)
});
});
}
setTrack() {
return __awaiter(this, void 0, void 0, function* () {