Component({ options: {}, /** * 组件的属性列表 */ properties: { show: { type: Boolean, value: false, }, }, /** * 组件的初始数据 */ data: { currentStep: 'first', }, lifetimes: { attached() {}, }, /** * 组件的方法列表 */ methods: { 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], }); }, }, });