form form disables dedicated components
<template> <div :class="disabled?'jeecg-form-container-disabled':''"> <fieldset :disabled="disabled"> <slot name="detail"></slot> </fieldset> <slot name="edit"></slot> <fieldset disabled> <slot></slot> </fieldset> </div> </template>
<script> /** *How to use * Just write this component directly under form. *<a-form layout="inline" :form="form" > * <j-form-container :disabled="true"> * <!-- The form content is omitted... --> * </j-form-container> *</a-form> */ export default { name: 'JFormContainer', props: { disabled: { type: Boolean, default: false, required: false } }, mounted () { ('I am disabling dedicated components for form, but I do not support disabling iframe content in form') } } </script>
<style> .jeecg-form-container-disabled{ cursor: not-allowed; } .jeecg-form-container-disabled fieldset[disabled] { -ms-pointer-events: none; pointer-events: none; } .jeecg-form-container-disabled .ant-select{ -ms-pointer-events: none; pointer-events: none; } .jeecg-form-container-disabled .ant-upload-select{display:none} .jeecg-form-container-disabled .ant-upload-list{cursor:grabbing} .jeecg-form-container-disabled fieldset[disabled] .ant-upload-list{ -ms-pointer-events: auto !important; pointer-events: auto !important; } .jeecg-form-container-disabled .ant-upload-list-item-actions .anticon-delete, .jeecg-form-container-disabled .ant-upload-list-item .anticon-close{ display: none; } </style>
<template> <a-form layout="inline" :form="form" > <j-form-container :disabled="true"> <!-- Form content omitted..... --> <a-row class="form-row" :gutter="16"> <a-col :lg="10" :md="10" :sm="20"> <a-form-item label="document"> <a-button> <a-icon type="upload" /> Upload </a-button> </a-form-item> </a-col> </a-row> <a-row class="form-row" :gutter="16"> <a-col :lg="10" :md="10" :sm="20"> <a-form-item label="document"> <a-button> <a-icon type="upload" /> Upload </a-button> </a-form-item> </a-col> </a-row> </j-form-container> </a-form> </template>
<script> import JFormContainer from '@/components/jeecg/JFormContainer' export default { components: { JFormContainer }, data () { return { form: this.$(this) } }, methods: {} } </script> <style scoped> </style>
Summarize
The above is personal experience. I hope you can give you a reference and I hope you can support me more.