提交 cbe4116a authored 作者: 王鹏飞's avatar 王鹏飞

update

上级 6660240b
<template>
<div id="app">
<vue-form :menus="menus" default-active="profile"></vue-form>
<vue-form
:menus="menus"
default-active="profile"
@change="handleChange"
@success="handleSuccess"
></vue-form>
</div>
</template>
<script>
......@@ -11,13 +16,18 @@ export default {
name: 'app',
data() {
return {
currentActive: null,
menus: sofiaForm
// menus: registerForm
}
},
methods: {
onSubmit(data) {
console.log(data)
handleChange(value) {
this.currentActive = value
console.log('页面切换了', value)
},
handleSuccess(data) {
console.log('提交成功了', data)
}
}
}
......
......@@ -6,7 +6,7 @@
<ezj-main :title="currentPage.title" v-if="currentPage" :key="activeId">
<slot>
<template v-if="currentPage.form">
<ezj-form-pane v-bind="currentPage"></ezj-form-pane>
<ezj-form-pane v-bind="currentPage" v-on="$listeners"></ezj-form-pane>
</template>
</slot>
</ezj-main>
......@@ -58,6 +58,7 @@ export default {
},
onSelect(id) {
this.activeId = id
this.$emit('change', id)
}
}
}
......
......@@ -140,7 +140,7 @@ export default {
axios.post(action, formData, { headers }).then(res => {
let { data } = res
callback && callback(data)
this.$emit('update', data)
this.$emit('success', data)
})
},
onSubmit(data) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论