You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
602 B
26 lines
602 B
|
6 years ago
|
<script type="text/jsx">
|
||
|
6 years ago
|
export default {
|
||
|
|
name: "AbstractFormItem",
|
||
|
6 years ago
|
|
||
|
6 years ago
|
functional: true,
|
||
|
6 years ago
|
|
||
|
6 years ago
|
props: {full: Boolean, dense: Boolean, label: String, prop: String},
|
||
|
6 years ago
|
|
||
|
6 years ago
|
render(h, context) {
|
||
|
|
const {full, dense, label, prop} = context.props
|
||
|
|
let attrs = {xs: 24, sm: 12, lg: 8}
|
||
|
6 years ago
|
|
||
|
6 years ago
|
if (full) attrs = {span: 24}
|
||
|
|
else if (dense) attrs.lg = 12
|
||
|
6 years ago
|
|
||
|
6 years ago
|
return (
|
||
|
|
<el-col {...{attrs}}>
|
||
|
|
<el-form-item label={label} prop={prop}>
|
||
|
|
{context.children}
|
||
|
|
</el-form-item>
|
||
|
|
</el-col>
|
||
|
|
)
|
||
|
6 years ago
|
}
|
||
|
6 years ago
|
}
|
||
|
6 years ago
|
</script>
|