提交
This commit is contained in:
55
甲情_甲意/miniprogram/node_modules/antd-mini/less/GuideTour/index.js
generated
vendored
Normal file
55
甲情_甲意/miniprogram/node_modules/antd-mini/less/GuideTour/index.js
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
import { __awaiter, __generator } from "tslib";
|
||||
import { Component, triggerEvent, triggerEventOnly } from '../_util/simply';
|
||||
import { GuideTourDefaultProps } from './props';
|
||||
import mixinValue from '../mixins/value';
|
||||
Component(GuideTourDefaultProps, {
|
||||
onNext: function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var currentValue, newCurrent;
|
||||
return __generator(this, function (_a) {
|
||||
currentValue = this.getValue();
|
||||
newCurrent = currentValue + 1;
|
||||
if (!this.isControlled()) {
|
||||
this.update(newCurrent);
|
||||
}
|
||||
triggerEvent(this, 'change', newCurrent);
|
||||
return [2 /*return*/];
|
||||
});
|
||||
});
|
||||
},
|
||||
onPrev: function () {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var currentValue, newCurrent;
|
||||
return __generator(this, function (_a) {
|
||||
currentValue = this.getValue();
|
||||
newCurrent = currentValue - 1;
|
||||
if (!this.isControlled()) {
|
||||
this.update(newCurrent);
|
||||
}
|
||||
triggerEvent(this, 'change', newCurrent);
|
||||
return [2 /*return*/];
|
||||
});
|
||||
});
|
||||
},
|
||||
onCancel: function () {
|
||||
triggerEventOnly(this, 'cancel');
|
||||
},
|
||||
onSwiperChange: function (e) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var current;
|
||||
return __generator(this, function (_a) {
|
||||
current = e.detail.current;
|
||||
if (!this.isControlled()) {
|
||||
this.update(current);
|
||||
}
|
||||
triggerEvent(this, 'change', current);
|
||||
return [2 /*return*/];
|
||||
});
|
||||
});
|
||||
},
|
||||
}, undefined, [
|
||||
mixinValue({
|
||||
valueKey: 'current',
|
||||
defaultValueKey: 'defaultCurrent',
|
||||
}),
|
||||
]);
|
Reference in New Issue
Block a user