0

このモデルをループバック 4 で実行しました。

@property({
    type: 'string',
    id: true,
    default: () => uuid(),
  })

  id: string;

  @property({
    type: 'string',
    required: true,
  })
  name: string;

ご覧のとおり、id はデフォルトで生成されます。しかし、ループバック/エクスプローラーでは

画像エクスプローラー

IDが表示されます。自動生成される場合、非表示にしたいのですが、この API を使用したい開発者に混乱を招く可能性があります。モデルにプロパティを配置し、それを非表示にする方法を知っている人はい/explorerますか?

ありがとう。

4

2 に答える 2

0

この方法を試すことができます:-

@model({
  settings: {hidden: ['password']}
})
class User extends Entity {
  // ...
  @property({
    type: 'string',
    required: true
  })
  password: string;
}
于 2019-07-18T07:37:48.090 に答える