复制成功!
<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: 'rate',
title: '评分1',
field: 'field1',
style: 'border:1px solid #333;padding:2px 10px;',
value: 3
},
{
type: 'rate',
title: '评分2',
field: 'field2',
style: {
border: '1px solid #333',
padding: '10px',
paddingTop: '2px',
paddingBottom: '2px',
},
value: 3
},
]
}
}
}
</script>