-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
Calling methods inside of data() is not allowed in 2.x? #4302
Comments
Hey @tzurbaev I am looking for solution, how can we achieve this ? |
@mbj36 this bug was fixed in v2.1.4, so you need to update Vue if you're still on old version. |
we still cannot call a method within a data? |
We can't call it too, on 2.5.21 version |
Then why this issue is closed? |
This does work. Pay attention to the posted jsfiddle. It opened with Javascript in the "no library (pure JS)" mode. As soon as I picked VueJS 2.2.1 from there (confirmed to work on 2.6.10 as well), it started giving the expected result. If you still have issues with this in your code, pay special attention to the |
Vue.js version
2.1.0
Reproduction Link
http://jsfiddle.net/ds8o0kry/
Steps to reproduce
Call any method inside of
data()
functionWhat is Expected?
Method should be called (just like in 1.x)
What is actually happening?
Uncaught TypeError: %method% is not a function
is thrownWe are migrating from vue 1.0.28 to 2.x and seems that
data()
behaviour changed but there's no info in migration guide, vue-migration-helper also says nothing about this. Is this a bug or possibility of calling methods insidedata()
was removed?The text was updated successfully, but these errors were encountered: