How to customize mdbInput?

Topic: How to customize mdbInput?

digitalmanagerguru pro asked a year ago

Hi there,

I've a doubt, sorry if silly, but I am currently using mdb-input component from you library and I am using for applying a mask to the input, but I loaded it globally.

Then I thought: It would be awesome if I had a way to load it locally, but for that I would need to have a way to customize the mdb-input so I can add that mask locally. That way everytime I used mdb-input, the mask would be available, since it would be responsability of the mdb-input, so I could encapsulate all in the same component.

I know that since it is loaded globally I can still use it everywhere, but still, would make more sense to be able to inbuilt to the component. And this is only an example, I could want to add extra fields to improve the current mdb-input. But maybe I am seeing all this wrong.

If you could clear this out for me, would be great. Thanks!

Hi there,

You can't change mdbInput component itself because it's loaded from node_modules directory and will be overwritten each time you update our library. The best way would be to load mdbInput inside your custom component and import mask dependency inside it (locally).

Best regards

Thanks for your insight! Appreciated!

Please insert min. 20 characters.


Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: Vue
  • MDB Version: 5.8.0
  • Device: Desktop
  • Browser: Chrome
  • OS: Win.10
  • Provided sample code: No
  • Provided link: Yes