Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Lazy option and fix directives #88

Merged

Conversation

marcosgomesneto
Copy link
Contributor

@marcosgomesneto marcosgomesneto commented Jan 8, 2024

closes #74

  • Adding the search for the closest input element to the "updated" directive
  • Add 'lazy' option to maintain compatibility with UI frameworks (example: Naive UI, ElementUI etc..)

NaiveUI Working Example

<n-input
    v-model:value="price"
    v-money="{
      decimal: ',',
      thousands: '.',
      precision: 2,
      masked: false,
      debug: true,
      lazy: false
    }"
/>

@marcosgomesneto marcosgomesneto marked this pull request as draft January 9, 2024 00:24
@marcosgomesneto marcosgomesneto marked this pull request as ready for review January 9, 2024 00:24
@marcosgomesneto marcosgomesneto marked this pull request as draft January 9, 2024 07:07
@marcosgomesneto marcosgomesneto marked this pull request as ready for review January 9, 2024 07:07
@jonathanpmartins jonathanpmartins merged commit 8abcd29 into jonathanpmartins:dev Jan 27, 2024
jonathanpmartins added a commit that referenced this pull request Jan 27, 2024
jonathanpmartins added a commit that referenced this pull request Jan 27, 2024
jonathanpmartins added a commit that referenced this pull request Jan 27, 2024
@jonathanpmartins
Copy link
Owner

jonathanpmartins commented Jan 27, 2024

I merged this pull request in, but I stopped development of this feature until the following topics are checked:

  • Understand better the the need to change the name of the event that the directive dispatches every time a value changes.
  • Understand why a setup validation method should be called on every updated method execution.

If the new feature is delivered it should have:

  • Tests
  • Docs

@marcosgomesneto For it to work with NaiveUI it must emit the input event?

jonathanpmartins added a commit that referenced this pull request Jan 27, 2024
@marcosgomesneto marcosgomesneto deleted the fix/directive branch January 29, 2024 04:04
@marcosgomesneto
Copy link
Contributor Author

@jonathanpmartins

Yes, for it to work with Naive UI, an "input" event needs to be emitted.

In the next commit I will document, test and explain the functionality better.

Thanks

@jonathanpmartins
Copy link
Owner

I believe it would be beneficial to introduce a new option, perhaps named 'emittedEventName,' with a default value of 'change' but allowing users to switch it to 'input.' What are your thoughts on this suggestion?

@marcosgomesneto
Copy link
Contributor Author

Yes, I believe this suggestion is more comprehensive than what I had suggested, as the user can define the name of the event as they wish. I also agree with the naming so that it is very clear what 'emittedEventName' is about.

@hamonCordova
Copy link

hamonCordova commented May 17, 2024

Was it merged? I think it would solve the problems using UI libs. With the latest version it not seems to work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants