Javascript 向vue表单向导选项卡内容添加上一个按钮
我正在使用vue表单向导() 我需要在第二个选项卡内容中添加一个按钮,而不是在页脚中添加上一个按钮 我尝试过类似的方法,但不起作用:Javascript 向vue表单向导选项卡内容添加上一个按钮,javascript,vue.js,Javascript,Vue.js,我正在使用vue表单向导() 我需要在第二个选项卡内容中添加一个按钮,而不是在页脚中添加上一个按钮 我尝试过类似的方法,但不起作用: <tab-content title="second tab"> <button @click="previousTab">Take me back to the previous tab</button> </tab-content> 让我回到上一页 如何在S
<tab-content title="second tab">
<button @click="previousTab">Take me back to the previous tab</button>
</tab-content>
让我回到上一页
如何在StepForm.vue中将“上一步”按钮添加到我的第二步内容中?好吧,您只需给
FormWizard
一个引用。然后使用该引用访问FormWizard
,并在按钮的单击处理程序中调用prevTab()
FormWizard
<form-wizard @on-complete="onComplete"
shape="square"
color="#3498db" ref="formWiz">
<tab-content title="Personal details"
icon="ti-user">
My first tab content
</tab-content>
<tab-content title="Additional Info"
icon="ti-settings">
My second tab content
<div>
<button @click="goBack">GO BACK !</button>
</div>
</tab-content>
<tab-content title="Last step"
icon="ti-check">
Yuhuuu! This seems pretty damn simple
</tab-content>
</form-wizard>
Vue.use(VueFormWizard)
new Vue({
el: '#app',
methods: {
onComplete: function() {
alert('Yay. Done!');
},
goBack() {
this.$refs.formWiz.prevTab()
}
}
})