util.js 374 B

12345678910111213
  1. import { cloneDeep } from '@cip/utils/util'
  2. export const setOptionWritable = (options, value) => {
  3. return options.map(option => {
  4. if (option?.config.children?.length > 0) {
  5. option.config.children = setOptionWritable(option.config.children, value)
  6. } else {
  7. option = cloneDeep(option)
  8. option.config.writable = value
  9. }
  10. return option
  11. })
  12. }