# 其他配置
# 配置 FormItem v2.5.0+
可以通过wrap
配置 FormItem
<template>
<div>
<form-create :rule="rule" v-model="fApi" :option="options"/>
</div>
</template>
<script>
export default {
data(){
return {
fApi:{},
options:{
onSubmit:(formData)=>{
alert(JSON.stringify(formData))
}
},
rule:[
{type:'input', field:'field1',title:'field1',value:'aaa'},
{type:'input', field:'field2',title:'field2',value:'sss',wrap:{labelWidth:'100px'}},
]
}
}
}
</script>
# 自定义 title v2.5.0+
<template>
<div>
<form-create :rule="rule" v-model="fApi" :option="options"/>
</div>
</template>
<script>
export default {
data(){
return {
fApi:{},
options:{
onSubmit:(formData)=>{
alert(JSON.stringify(formData))
}
},
rule:[
{type:'input', field:'field1',title:'field1',value:'aaa'},
{type:'input', field:'field2',title:{style:'color:red',title:'field2'},value:'sss'},
]
}
}
}
</script>
# 自定义 info v2.5.0+
<template>
<div>
<form-create :rule="rule" v-model="fApi" :option="options"/>
</div>
</template>
<script>
export default {
data(){
return {
fApi:{},
options:{
onSubmit:(formData)=>{
alert(JSON.stringify(formData))
}
},
rule:[
{type:'input', field:'field1',title:'field1',info:'info.....',value:'aaa'},
{type:'input', field:'field2',title:'field2',info:{info:'info.....',align:'left'},value:'aaa'},
{type:'input', field:'field3',title:'field3',info:{info:'info.....',style:'color:red'},value:'sss'},
]
}
}
}
</script>