复制成功!
<template>
<div>
<form-create :rule="rule" v-model:api="fApi" :option="options"/>
</div>
</template>
<script>
export default {
data() {
return {
fApi: {},
options: {
onSubmit: (formData) => {
alert(JSON.stringify(formData))
}
},
rule: [
{
type: 'el-tabs',
style: 'width: 100%;',
field: 'activeKey',
value: '2',
modelField: 'activeKey',
children: [
{
type: 'el-tab-pane',
props: {
label: 'tab 1',
},
key: '1',
children: [{
type: 'input',
field: 'input1',
title: 'input1',
}]
},
{
type: 'el-tab-pane',
props: {
label: 'tab 2',
},
key: '2',
children: [{
type: 'input',
field: 'input2',
title: 'input2',
}]
},
]
}
]
}
}
}
</script>