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

Vue variable not updated. #6135

Closed
vad11 opened this issue Jul 17, 2017 · 10 comments
Closed

Vue variable not updated. #6135

vad11 opened this issue Jul 17, 2017 · 10 comments

Comments

@vad11
Copy link

vad11 commented Jul 17, 2017

Version

2.4.1

Reproduction link

http://jsfiddle.net/vadvad/1pohLabg/22/

Steps to reproduce

Vue variable not updated after resive change message.

What is expected?

type = ok

What is actually happening?

type = not

@jkzing
Copy link
Member

jkzing commented Jul 17, 2017

Why using jQuery to do that? Did a quick fix to your fiddle:
http://jsfiddle.net/vadvad/1pohLabg/9/

@vad11
Copy link
Author

vad11 commented Jul 17, 2017

Please see updated link
http://jsfiddle.net/vadvad/1pohLabg/22/

@nickmessing
Copy link
Member

@vad11, v-model listens for input event to detect changes, doing something.value = 'new value' doesn't trigger input event.

@vad11
Copy link
Author

vad11 commented Jul 17, 2017

Yes, but I send document.querySelector('input[name=type]').trigger('change') ;

@rekateka
Copy link

rekateka commented Jul 17, 2017

@vad11 - you don't need and shouldn't use jQuery or document.querySelector when using Vue's v-model. All you have to do is the following: http://jsfiddle.net/1pohLabg/24/

I would recommend you read the Vue Guide, in particular Handling User Input. There might be some misunderstanding about how Vue should be used.

@vad11
Copy link
Author

vad11 commented Jul 17, 2017

I use jquery plugin in working project (select list, time, ...). Plugin make many operation and I want resive result from plugin by setting value to hidden input variable. This is clean and simply way to do this. If I work with vue you massege accepted, but this is not state. I must change value from jquery plagin and trigger vue to update this variable. This not work. Vue not update variable.

@posva
Copy link
Member

posva commented Jul 17, 2017

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server, gitter or StackOverflow.


Vue cannot listen back to setting the value directly into the DOM element

@posva posva closed this as completed Jul 17, 2017
@vad11
Copy link
Author

vad11 commented Jul 17, 2017

Please see #372 in bug reports. Writed that is solved, but I make this and for me this not work. May be this bug. I don't now. But please help me solve this problem.

@nirazul
Copy link

nirazul commented Jul 17, 2017

Ask here: https://stackoverflow.com/tags/vue.js

@mastrobardo
Copy link

I'm tryng to e2e with cypress and datetimepicker (vuetify). I setup an hidden input, triggered the change as expected, but the model doesnt get any update

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

No branches or pull requests

7 participants