feat: 添加引导页

This commit is contained in:
2025-06-18 17:37:01 +08:00
parent 526ad49981
commit 145ca0bf62
3 changed files with 59 additions and 24 deletions
@@ -12,7 +12,9 @@ Component({
/**
* 组件的初始数据
*/
data: {},
data: {
currentStep: 'first',
},
lifetimes: {
attached() {},
},
@@ -23,5 +25,17 @@ Component({
onClose() {
this.triggerEvent('onClose');
},
toNextStep() {
const stepArr = ['first', 'second', 'third', 'fourth', 'fifth'];
const { currentStep } = this.data;
const currentStepIndex = currentStep
? stepArr.indexOf(currentStep)
: 0;
console.log('next', stepArr[currentStepIndex + 1]);
this.setData({
currentStep: stepArr[currentStepIndex + 1],
});
},
},
});