跳转到内容

renderConfig — 渲染配置

import * as v from 'valibot';
import { renderConfig } from '@piying/view-angular-core';

const schema = v.object({
  field1: v.pipe(v.string(), renderConfig({ hidden: true })),
  field2: v.pipe(v.string(), renderConfig({ hidden: false })),
});

输入:{ hidden }hidden: true 时字段组件不渲染。字段仍然参与表单,值保留在模型里。

renderConfig({ hidden }) hideWhen
隐藏状态 静态,写死在 schema 里 跟随其他字段的值动态变化
适用 内部字段、始终不展示的字段 联动隐藏

动态隐藏见 hideWhen