我正在尝试更改Angular中NGXMASK中的默认提示器

发布于 2025-01-18 07:58:48 字数 730 浏览 3 评论 0原文

我在 Angular 中使用 ngxmask 以以下模式显示电话号码:

(000) 000-0000

我设置showMaskTyped 属性设置为 true 以始终在输入中显示掩码模式,如下所示:

(___) ___-____

我想将 _ 替换为自定义值 <代码># 这样它看起来如下:

(###) ###-####

这是代码:

<input mask="(000) 000-0000" [showMaskTyped]="true">

这是实时示例: https://jsdaddy.github.io/ngx-mask-page/mask-component#show-mask

将默认 _ 替换为 < 的最佳方法是什么代码>#?

I am using ngxmask in Angular to display the phone number in the following pattern:

(000) 000-0000

I set showMaskTyped Property to true to always display the mask pattern in the input which looks as the following:

(___) ___-____

I want to replace the _ with custom value # so that it looks like the following:

(###) ###-####

Here is the code:

<input mask="(000) 000-0000" [showMaskTyped]="true">

Here is the live example: https://jsdaddy.github.io/ngx-mask-page/mask-component#show-mask

What would be the best way to replace the default _ with #?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

掌心的温暖 2025-01-25 07:58:48

根据文档,将允许您覆盖默认的_

就您而言,您将执行以下操作:

<input mask="(000) 000-0000" [showMaskTyped]="true" placeHolderCharacter="#" />

According to the documentation, placeHolderCharacter will allow you to override the default _.

In your case, you will do the following:

<input mask="(000) 000-0000" [showMaskTyped]="true" placeHolderCharacter="#" />
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文