小编Nek*_*u80的帖子

Prettier - 功能和注释之间的新界线

我想知道是否有规则在带有 prettier 的打字稿中的函数/语句和注释之间添加新行(项目根目录下的 .prettierrc )。

当前行为:

 } else if (request.type === 'membership-fee') {
    /**
     * If type is membership fee
     */
    this.form.get('total')?.setValue(this.gym?.membership_fee?.total);
} else {
    /**
     * Operation type not recognized
     */
    this.toast.error('Tipo di operazione non riconosciuto');
    ($('#editSaleModal') as any).modal('hide');
}
Run Code Online (Sandbox Code Playgroud)

期望的行为:

 } else if (request.type === 'membership-fee') {
    
    /**
     * If type is membership fee
     */
    this.form.get('total')?.setValue(this.gym?.membership_fee?.total);
} else {
    
    /**
     * Operation type not recognized
     */
    this.toast.error('Tipo di operazione non riconosciuto');
    ($('#editSaleModal') as any).modal('hide');
}
Run Code Online (Sandbox Code Playgroud)

我当前的 .prettierc:

{ …
Run Code Online (Sandbox Code Playgroud)

typescript visual-studio-code angular prettier

5
推荐指数
1
解决办法
6271
查看次数

删除 HTML5 验证中的“请填写此字段”消息

我有一个选项卡系统(隐藏其他选项卡),我找到了在不同选项卡中出现错误时通知用户的方法。

我唯一需要做的就是删除出现在页面左上角的“请填写此字段”的消息,因为显然它不漂亮,也没有指向任何内容

我要删除的弹出窗口的屏幕截图

html validation

2
推荐指数
1
解决办法
5336
查看次数