Javascript 如何在不更改vue表单向导的情况下运行nextStep方法
使用和创建多步骤表单 我需要在单击按钮时运行一个名为nextStep的方法。它可以工作,但如果我离开模式,它会导致选项卡索引设置为0,并再次运行代码(它不应该这样做) 模态分量Javascript 如何在不更改vue表单向导的情况下运行nextStep方法,javascript,vue.js,Javascript,Vue.js,使用和创建多步骤表单 我需要在单击按钮时运行一个名为nextStep的方法。它可以工作,但如果我离开模式,它会导致选项卡索引设置为0,并再次运行代码(它不应该这样做) 模态分量 <b-button variant="outline-primary" v-b-modal.modal-center >Find a builder</b-button > <b-modal id="modal-center"
<b-button variant="outline-primary" v-b-modal.modal-center
>Find a builder</b-button
>
<b-modal
id="modal-center"
centered
title="Find a builder"
hide-header
hide-footer
>
<button
type="button"
class="close"
data-dismiss="modal"
aria-label="Close"
@click="$bvModal.hide('modal-center')"
>
<span aria-hidden="true">×</span>
</button>
<div class="m-4">
<MultiStep />
</div>
</b-modal>
我尝试删除更改时的按钮并将其调整为以下值,但这会导致我的表单无法正常工作
<wizard-button
v-if="props.activeTabIndex === 0"
class="wizard-footer"
:style="props.fillButtonStyle"
@click.native="nextStep"
>Next</wizard-button
>
下一步
如何让我的方法在没有@on change=“nextStep”的情况下运行
nextStep() {
var currentTab = null;
currentTab = this.$refs.wizard.activeTabIndex;
if (currentTab === 0) {
this.startValidation();
}
if (currentTab === 1) {
}
if (currentTab === 2) {
}
},
<wizard-button
v-if="props.activeTabIndex === 0"
class="wizard-footer"
:style="props.fillButtonStyle"
@click.native="nextStep"
>Next</wizard-button
>