Comments (28)
I saw a workaround somewhere and the same solution works to Vuetify
https://codepen.io/mukatk/pen/NYZvPW
from v-money.
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.
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.
<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.
I'll check it.
from v-money.
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.
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.
workaround solution
https://gist.github.com/RodrigoFraga/49cf179c3fdf5c6f775450b613137bd3
from v-money.
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.
same issue
from v-money.
Same here. Any update?
from v-money.
Same here...
from v-money.
the problem is with v-text-field, with input works good
from v-money.
Same here... but I'm using ElementUI (element.eleme.io)
from v-money.
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.
@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.
I must of been looking at something incorrectly, thanks @paulpv
from v-money.
@johnleider NP; I am certain you are busy!
from v-money.
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.
This plugin breaks reactivity of inputs after adding the v-money parameter. I'm using v-model binded to vuex state.
from v-money.
v-model.lazy
doesn't work on components, you have to listen to @change
yourself: https://codepen.io/anon/pen/BqmBjb?editors=1010
Edit: the mask then breaks after resetting the input, so there's still a bug somewhere
from v-money.
Just one more option :
https://www.npmjs.com/package/v-currency-field
from v-money.
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.
Any update on this?
Edit:
For NightwatchJS this seems to be a good approach:
nightwatchjs/nightwatch#1132 (comment)
from v-money.
same here
from v-money.
@kevinfaguiar Your solution work for me I'm using v-money and vuetify
from v-money.
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.
I can't reset for native input also.
https://jsfiddle.net/nj3cLoum/2/
from v-money.
Related Issues (20)
- campo de preço sem a opção do usuário colocar os centavos HOT 1
- I'm new here: How to install? HOT 2
- Not working with big Integer HOT 2
- How to associate with a label? HOT 1
- v-money deprecated? HOT 4
- Having numbers in suffix property it gives me an infinite loop HOT 2
- toFixed(x) for non-masked values HOT 1
- Update values of child component with v-money HOT 2
- Support for Vue3 (with v-money3) HOT 1
- Error on null value and do not return Empty String HOT 2
- How to override global options
- how to format value only for display?
- Is it possible to change the direction of the inputs from rtl to ltr?
- Use on ionic
- Zeros being deleted unnecessarily HOT 1
- How to apply v-money to dynamically generated inputs HOT 1
- Display decimal depois da Virgula HOT 2
- How to disabled negative number? HOT 2
- always keep the cents empty HOT 1
- support amounts with no decimal? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from v-money.