跳到内容
SCRM DOC
创建于2024-02-15更新于 2024-04-09

禁用表单所有组件

通过 BaseForm disabled 属性进行表单全局禁用控制

useForm({
  labelWidth: 120,
  //禁用表单所有组件
  disabled:true,
});

效果如下

弹框内下拉框错位如何处理,如下图

处理方法,使用 getPopupContainer: (node) => document.body 或者 getPopupContainer: (node) => node.parentNode

{
  field: 'ruleConditions',
  label: '条件规则',
  required: true,
  component: 'ApiSelect',
  componentProps: {
    api: ajaxGetDictItems,
    params:{code:'rule_conditions'},
    labelField: 'text',
    valueField: 'value',
    getPopupContainer: (node) => document.body,
  },
},

使用后效果如下

Drawer(抽屉)宽度自适应的解决方案

使用 useDrawerAdaptiveWidth

参考 UserDrawer.vue 的实现。

// step1 引入useDrawerAdaptiveWidth方法
import {useDrawerAdaptiveWidth} from '/@/hooks/jeecg/useAdaptiveWidth'
// step2 获取到adaptiveWidth
const {adaptiveWidth} = useDrawerAdaptiveWidth()
<!-- step3 在页面上使用 -->
<BasicDrawer
    @register="registerDrawer"
    :width="adaptiveWidth"
/>

自定义宽度范围

useDrawerAdaptiveWidth 定义了一些默认的自适应宽度,可以应对大多数情况,但是如果当默认的自适应宽度范围无法满足的需求时,就可以自己实现自适应宽度了。 你可以参考下图的默认配置进行修改。

页面信息›
已优化否

本页目录