nocobase/docs/en-US/development/server/collections/field-extension.md
2022-11-07 09:42:52 +08:00

1.2 KiB

How to extend fields

The composition of a Collection Field in NocoBase consists of

Extend Field Type

For example, to extend the password type field ``type: 'password'`

export class MyPlugin extends Plugin {
  beforeLoad() {
    this.db.registerFieldTypes({
      password: PasswordField
    });
  }
}

export class PasswordField extends Field {
  get dataType() {
    return DataTypes.STRING;
  }
}

Extend Field Component

Related extension documentation can be found at

Extend Field Interface