Giter Club home page Giter Club logo

Comments (28)

mukatk avatar mukatk commented on September 27, 2024 53

I saw a workaround somewhere and the same solution works to Vuetify

https://codepen.io/mukatk/pen/NYZvPW

from v-money.

luizhenriquerdias avatar luizhenriquerdias commented on September 27, 2024 20

I made a directive based on v-money that works with Vuetify (v-text-field) and normal inputs.
Note: I made it to work with Brazilian Real (R$) but you can change in the code.

https://github.com/luizhenriquerdias/v-money

from v-money.

kevinfaveri avatar kevinfaveri commented on September 27, 2024 8

While there is no solution, pure Javascript can be used to set the input value and then create an 'Input' event, which is the event that the 'v-model' directive listens to:
domInputElement.value = newValue;
domInputElement.dispatchEvent(new Event('input'));

from v-money.

ElizeuBraga avatar ElizeuBraga commented on September 27, 2024 6

<v-text-field maxlength="10" v-money="money" ref="productPrice" label="Product price" v-model="productPrice"></v-text-field>
const input = this.$refs.productPrice.$el.querySelector("input");
input.value = "new value";`

this works for me

from v-money.

neves avatar neves commented on September 27, 2024 4

I'll check it.

from v-money.

evandroabukamel avatar evandroabukamel commented on September 27, 2024 3

I'm having the same problem.

I put v-money inside another component. When I try to programmatically change the value on the v-model of the parent component, the v-money keeps the old value.

[FIXED] I was using a this.$nextTick without need to change the child component value.

from v-money.

1985michel avatar 1985michel commented on September 27, 2024 3

Hi!

I did a watch using the @ElizeuBraga solution and it's working very well:

<v-text-field
        ref="valormascarado"
        outlined
        v-model="editedItem.valor"
        v-money="money"
        label="Valor"
></v-text-field>

watch:{
editedItem() {
      let input = this.$refs.valormascarado.$el.querySelector("input");
      input.value = this.editedItem.valor;
    },
}

from v-money.

RodrigoFraga avatar RodrigoFraga commented on September 27, 2024 1

workaround solution
https://gist.github.com/RodrigoFraga/49cf179c3fdf5c6f775450b613137bd3

from v-money.

jonathanpmartins avatar jonathanpmartins commented on September 27, 2024 1

hey,
Unfortunately I don't think support will come soon. This repo seems to be abandoned! I decided to upgrade this package to be used with Vue3.

Welcome v-money3!

I'm interested to maintain v-money3 for vue 3 and beyond. Feel free to open this same issue there if you are planning to upgrade your project.

from v-money.

lchhieu avatar lchhieu commented on September 27, 2024

same issue

from v-money.

luizhenriquerdias avatar luizhenriquerdias commented on September 27, 2024

Same here. Any update?

from v-money.

rafaellarrosa avatar rafaellarrosa commented on September 27, 2024

Same here...

from v-money.

rafaellarrosa avatar rafaellarrosa commented on September 27, 2024

the problem is with v-text-field, with input works good

from v-money.

kevinfaveri avatar kevinfaveri commented on September 27, 2024

Same here... but I'm using ElementUI (element.eleme.io)

from v-money.

johnleider avatar johnleider commented on September 27, 2024

We are currently in the process of updating all form components for v1.1. If you can fix the codepen to produce the issue, I can verify it against our latest work.

from v-money.

paulpv avatar paulpv commented on September 27, 2024

@johnleider What do you mean "If you can fix the codepen to produce the issue"?
The original codepen (https://codepen.io/talski/pen/MOxZXX?editors=1011) produces the issue and doesn't log any console errors.
I have a slight variant of the original code pen that uses an array of prices instead of a single price:
https://codepen.io/paulpv/pen/oqMeXd

from v-money.

johnleider avatar johnleider commented on September 27, 2024

I must of been looking at something incorrectly, thanks @paulpv

from v-money.

paulpv avatar paulpv commented on September 27, 2024

@johnleider NP; I am certain you are busy!

from v-money.

MartinX3 avatar MartinX3 commented on September 27, 2024

in my e2e tests with selenium / chromedriver I saw the same issue.
With nightwatch and gebish.
The new value gets appended to the old one.

from v-money.

averied avatar averied commented on September 27, 2024

This plugin breaks reactivity of inputs after adding the v-money parameter. I'm using v-model binded to vuex state.

from v-money.

KaelWD avatar KaelWD commented on September 27, 2024

v-model.lazy doesn't work on components, you have to listen to @change yourself: https://codepen.io/anon/pen/BqmBjb?editors=1010

vuejs/vue#6914

Edit: the mask then breaks after resetting the input, so there's still a bug somewhere

from v-money.

luizrobertomeier avatar luizrobertomeier commented on September 27, 2024

Just one more option :
https://www.npmjs.com/package/v-currency-field

from v-money.

Nerossoul avatar Nerossoul commented on September 27, 2024

I'm having the same problem.

I put v-money inside another component. When I try to programmatically change the value on the v-model of the parent component, the v-money keeps the old value.

[FIXED] I was using a this.$nextTick without need to change the child component value.

Can you show how to use a this.$nextTick to change v-money value?

from v-money.

MartinX3 avatar MartinX3 commented on September 27, 2024

Any update on this?

Edit:
For NightwatchJS this seems to be a good approach:
nightwatchjs/nightwatch#1132 (comment)

from v-money.

danielorkae avatar danielorkae commented on September 27, 2024

same here

from v-money.

valterbarros avatar valterbarros commented on September 27, 2024

@kevinfaguiar Your solution work for me I'm using v-money and vuetify

from v-money.

yvescavalcanti avatar yvescavalcanti commented on September 27, 2024

Same problem with bootstrap-vue when i try to extend Money. If i try to set the value programatically then it is restored to previous value.

from v-money.

Adrug avatar Adrug commented on September 27, 2024

I can't reset for native input also.
https://jsfiddle.net/nj3cLoum/2/

from v-money.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.