feat: 添加引导页
This commit is contained in:
@@ -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],
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user